diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-03-05 10:17:42 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-03-05 10:17:42 +0000 |
| commit | 4f9afb9343b6605fd39f3cca503640b215c92202 (patch) | |
| tree | d16bad5244983f33a9f12ea44c49d504440a6449 /src/runtime/c/pgf/graphviz.c | |
| parent | d04ffb60acd171912fb5a8e829faf803eec4ad67 (diff) | |
implementation for pre in the C runtime
Diffstat (limited to 'src/runtime/c/pgf/graphviz.c')
| -rw-r--r-- | src/runtime/c/pgf/graphviz.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/runtime/c/pgf/graphviz.c b/src/runtime/c/pgf/graphviz.c index 9410c68a6..9668762db 100644 --- a/src/runtime/c/pgf/graphviz.c +++ b/src/runtime/c/pgf/graphviz.c @@ -127,41 +127,6 @@ pgf_bracket_lzn_symbol_token(PgfLinFuncs** funcs, PgfToken tok) } static void -pgf_bracket_lzn_expr_literal(PgfLinFuncs** funcs, PgfLiteral lit) -{ - PgfBracketLznState* state = gu_container(funcs, PgfBracketLznState, funcs); - - GuString label = NULL; - - GuVariantInfo i = gu_variant_open(lit); - switch (i.tag) { - case PGF_LITERAL_STR: { - PgfLiteralStr* lstr = i.data; - label = lstr->val; - break; - } - case PGF_LITERAL_INT: { - PgfLiteralInt* lint = i.data; - label = gu_format_string(state->pool, "%d", lint->val); - break; - } - case PGF_LITERAL_FLT: { - PgfLiteralFlt* lflt = i.data; - label = gu_format_string(state->pool, "%f", lflt->val); - break; - } - default: - gu_impossible(); - } - - PgfParseNode* node = gu_new(PgfParseNode, state->pool); - node->id = 100000 + gu_buf_length(state->leaves); - node->parent = state->parent; - node->label = label; - gu_buf_push(state->leaves, PgfParseNode*, node); -} - -static void pgf_bracket_lzn_begin_phrase(PgfLinFuncs** funcs, PgfCId cat, int fid, int lindex, PgfCId fun) { PgfBracketLznState* state = gu_container(funcs, PgfBracketLznState, funcs); @@ -211,7 +176,6 @@ pgf_bracket_lzn_end_phrase(PgfLinFuncs** funcs, PgfCId cat, int fid, int lindex, static PgfLinFuncs pgf_bracket_lin_funcs = { .symbol_token = pgf_bracket_lzn_symbol_token, - .expr_literal = pgf_bracket_lzn_expr_literal, .begin_phrase = pgf_bracket_lzn_begin_phrase, .end_phrase = pgf_bracket_lzn_end_phrase, .symbol_ne = NULL, @@ -283,7 +247,7 @@ pgf_graphviz_parse_tree(PgfConcr* concr, PgfExpr expr, GuOut* out, GuExn* err) state.level = -1; state.internals = gu_new_buf(GuBuf*, tmp_pool); state.leaves = gu_new_buf(PgfParseNode*, tmp_pool); - pgf_lzr_linearize(concr, ctree, 0, &state.funcs); + pgf_lzr_linearize(concr, ctree, 0, &state.funcs, tmp_pool); size_t len = gu_buf_length(state.internals); for (size_t i = 0; i < len; i++) { |
