The implementation assumed there would be no rules starting with
terminals since they were eliminated at the first chance. However, rules
starting with a non-terminal which produced the empty string followed by
a terminal were added to the set of rules.
git-archimport-id: cascardo@tlscascardo--private/libgrammatic--nogobject-lr1--0.1--patch-10
first_set->has_empty = TRUE;
rule_delete (next_rule);
}
- else
+ else if (next_symbol->terminal == FALSE)
{
symbol_t* next_symbol;
next_symbol = next_symbols->data;
- /* TODO: Check this assertion is correct. */
- assert (next_symbol->terminal == FALSE);
/* This is an indirect recursive rule. */
if (next_symbol->value == symbol->value)
{
new_rules = g_list_prepend (new_rules, next_rule);
}
}
+ else
+ {
+ rule_delete (next_rule);
+ }
next_rules = g_list_next (next_rules);
}
}