forked from GitHub/gf-core
flush the pre stack at the end of the linearization as well
This commit is contained in:
@@ -184,6 +184,7 @@ void PgfLinearizer::flush_pre_stack(PgfLinearizationOutputIface *out, PgfText *t
|
|||||||
PreStack *pre = pre_stack;
|
PreStack *pre = pre_stack;
|
||||||
pre_stack = pre->next;
|
pre_stack = pre->next;
|
||||||
|
|
||||||
|
if (token != NULL) {
|
||||||
for (size_t i = 0; i < pre->sym_kp->alts.len; i++) {
|
for (size_t i = 0; i < pre->sym_kp->alts.len; i++) {
|
||||||
PgfAlternative *alt = &pre->sym_kp->alts.data[i];
|
PgfAlternative *alt = &pre->sym_kp->alts.data[i];
|
||||||
for (size_t j = 0; j < alt->prefixes->len; j++) {
|
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);
|
linearize(out, pre->node, pre->sym_kp->default_form);
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
void reverse_and_label();
|
void reverse_and_label();
|
||||||
void linearize(PgfLinearizationOutputIface *out) {
|
void linearize(PgfLinearizationOutputIface *out) {
|
||||||
linearize(out, root, 0);
|
linearize(out, root, 0);
|
||||||
|
flush_pre_stack(out, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
~PgfLinearizer();
|
~PgfLinearizer();
|
||||||
|
|||||||
Reference in New Issue
Block a user