flush the pre stack at the end of the linearization as well

This commit is contained in:
krangelov
2021-12-03 14:52:31 +01:00
parent d10f63c16b
commit 348963d13c
2 changed files with 10 additions and 7 deletions

View File

@@ -184,6 +184,7 @@ void PgfLinearizer::flush_pre_stack(PgfLinearizationOutputIface *out, PgfText *t
PreStack *pre = pre_stack;
pre_stack = pre->next;
if (token != NULL) {
for (size_t i = 0; i < pre->sym_kp->alts.len; i++) {
PgfAlternative *alt = &pre->sym_kp->alts.data[i];
for (size_t j = 0; j < alt->prefixes->len; j++) {
@@ -194,6 +195,7 @@ void PgfLinearizer::flush_pre_stack(PgfLinearizationOutputIface *out, PgfText *t
}
}
}
}
linearize(out, pre->node, pre->sym_kp->default_form);

View File

@@ -82,6 +82,7 @@ public:
void reverse_and_label();
void linearize(PgfLinearizationOutputIface *out) {
linearize(out, root, 0);
flush_pre_stack(out, NULL);
}
~PgfLinearizer();