From 13822c9a2d220d4a76e5d39b585a3c57024bb665 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 30 Sep 2013 10:25:39 +0000 Subject: better handling for nonExist in the C runtime. BIND is also supported in the linearizer but not in the parser yet --- src/runtime/c/pgf/parser.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'src/runtime/c/pgf/parser.c') 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 +#include #include #include @@ -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) { -- cgit v1.2.3