summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/parser.c
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-09-30 10:25:39 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-09-30 10:25:39 +0000
commit13822c9a2d220d4a76e5d39b585a3c57024bb665 (patch)
tree6047f167698d027561008d1c71c72e74925f5a14 /src/runtime/c/pgf/parser.c
parent7c0936b7ce23098c052253f7aa3db0c6f3d33054 (diff)
better handling for nonExist in the C runtime. BIND is also supported in the linearizer but not in the parser yet
Diffstat (limited to 'src/runtime/c/pgf/parser.c')
-rw-r--r--src/runtime/c/pgf/parser.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/runtime/c/pgf/parser.c b/src/runtime/c/pgf/parser.c
index 188672dd3..c83873b5e 100644
--- a/src/runtime/c/pgf/parser.c
+++ b/src/runtime/c/pgf/parser.c
@@ -1,4 +1,5 @@
#include <pgf/parser.h>
+#include <pgf/linearizer.h>
#include <gu/seq.h>
#include <gu/assert.h>
@@ -1734,38 +1735,6 @@ typedef struct {
PgfParseState* state;
} PgfPrefixTokenState;
-static GuString
-pgf_get_tokens(PgfSequence* seq, uint16_t seq_idx, GuPool* pool)
-{
- GuPool* tmp_pool = gu_new_pool();
- GuExn* err = gu_new_exn(NULL, gu_kind(type), tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
- GuOut* out = gu_string_buf_out(sbuf);
-
- // collect the tokens in the production
- size_t len = gu_seq_length(seq);
- for (size_t i = seq_idx; i < len; i++) {
- PgfSymbol sym = gu_seq_get(seq, PgfSymbol, i);
-
- GuVariantInfo i = gu_variant_open(sym);
- switch (i.tag) {
- case PGF_SYMBOL_KS: {
- PgfSymbolKS* symks = i.data;
- gu_string_write(symks->token, out, err);
- }
- default:
- goto end;
- }
- }
-
-end:;
- GuString tokens = gu_string_buf_freeze(sbuf, pool);
-
- gu_pool_free(tmp_pool);
-
- return tokens;
-}
-
static bool
pgf_prefix_match_token(PgfTokenState* ts0, PgfToken tok, PgfItem* item)
{