mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -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;
|
||||
pre_stack = pre->next;
|
||||
|
||||
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++) {
|
||||
ref<PgfText> prefix = *vector_elem(alt->prefixes,j);
|
||||
if (textstarts(token, &(*prefix))) {
|
||||
linearize(out, pre->node, alt->form);
|
||||
goto done;
|
||||
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++) {
|
||||
ref<PgfText> prefix = *vector_elem(alt->prefixes,j);
|
||||
if (textstarts(token, &(*prefix))) {
|
||||
linearize(out, pre->node, alt->form);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
void reverse_and_label();
|
||||
void linearize(PgfLinearizationOutputIface *out) {
|
||||
linearize(out, root, 0);
|
||||
flush_pre_stack(out, NULL);
|
||||
}
|
||||
|
||||
~PgfLinearizer();
|
||||
|
||||
Reference in New Issue
Block a user