mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
flush the pre stack at the end of the linearization as well
This commit is contained in:
@@ -184,13 +184,15 @@ 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;
|
||||||
|
|
||||||
for (size_t i = 0; i < pre->sym_kp->alts.len; i++) {
|
if (token != NULL) {
|
||||||
PgfAlternative *alt = &pre->sym_kp->alts.data[i];
|
for (size_t i = 0; i < pre->sym_kp->alts.len; i++) {
|
||||||
for (size_t j = 0; j < alt->prefixes->len; j++) {
|
PgfAlternative *alt = &pre->sym_kp->alts.data[i];
|
||||||
ref<PgfText> prefix = *vector_elem(alt->prefixes,j);
|
for (size_t j = 0; j < alt->prefixes->len; j++) {
|
||||||
if (textstarts(token, &(*prefix))) {
|
ref<PgfText> prefix = *vector_elem(alt->prefixes,j);
|
||||||
linearize(out, pre->node, alt->form);
|
if (textstarts(token, &(*prefix))) {
|
||||||
goto done;
|
linearize(out, pre->node, alt->form);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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