From 7e1a2447c2d3c3e3adfe9d4a0755c062cda8052b Mon Sep 17 00:00:00 2001 From: krangelov Date: Wed, 1 Dec 2021 13:58:12 +0100 Subject: [PATCH] PgfSymbolLit is the same as PgfSymbolCat for the linearizer --- src/runtime/c/pgf/linearizer.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runtime/c/pgf/linearizer.cxx b/src/runtime/c/pgf/linearizer.cxx index 7f118baf0..9bc552b8c 100644 --- a/src/runtime/c/pgf/linearizer.cxx +++ b/src/runtime/c/pgf/linearizer.cxx @@ -173,6 +173,21 @@ void PgfLinearizer::linearize(PgfLinearizationOutputIface *out, TreeNode *node, } case PgfSymbolLit::tag: { auto sym_lit = ref::untagged(sym); + + size_t d = sym_lit->d; + TreeNode *arg = node->args; + while (d > 0) { + arg = arg->next_arg; + if (arg == 0) + throw pgf_error("Found inconsistency in the PMCFG representation"); + d--; + } + size_t lindex = node->eval_param(&sym_lit->r); + PgfText *cat = &vector_elem(hypos, sym_lit->d)->type->name; + + out->begin_phrase(cat, 0, NULL, &node->lin->name); + linearize(out, arg, lindex); + out->end_phrase(cat, 0, NULL, &node->lin->name); break; } case PgfSymbolVar::tag: {