mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
multistart: introduce and use rule_is_initial
* src/gram.h (rule_is_initial): New. * src/graphviz.c, src/print-xml.c, src/print.c, src/lalr.c: Use it. Some of these occurrences were incorrect (checking whether this is rule 0), and not behaving properly in the case of multistart.
This commit is contained in:
@@ -198,8 +198,7 @@ print_reduction (FILE *out, size_t width,
|
||||
fputc (' ', out);
|
||||
if (!enabled)
|
||||
fputc ('[', out);
|
||||
const bool final = r->lhs->symbol == acceptsymbol;
|
||||
if (final)
|
||||
if (rule_is_initial (r))
|
||||
fprintf (out, _("accept"));
|
||||
else
|
||||
fprintf (out, _("reduce using rule %d (%s)"), r->number,
|
||||
@@ -318,7 +317,7 @@ print_reductions (FILE *out, const state *s)
|
||||
aver (STREQ (default_reductions, "most")
|
||||
|| (STREQ (default_reductions, "consistent")
|
||||
&& default_reduction_only)
|
||||
|| (reds->num == 1 && reds->rules[0]->number == 0));
|
||||
|| (reds->num == 1 && rule_is_initial (reds->rules[0])));
|
||||
(void) default_reduction_only;
|
||||
free (default_reductions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user