mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
* src/gram.c (ritem_print): Be sure to subtract 1 when displaying
rule line numbers. * src/closure.c (print_closure): Likewise. * src/derives.c (print_derives): Likewise. * tests/sets.at (Nullable): Adjust: the rule numbers are correct now.
This commit is contained in:
@@ -62,7 +62,7 @@ print_closure (const char *title, short *array, size_t size)
|
||||
fprintf (stderr, " %2d: .", array[i]);
|
||||
for (rp = &ritem[array[i]]; *rp >= 0; ++rp)
|
||||
fprintf (stderr, " %s", tags[*rp]);
|
||||
fprintf (stderr, " (rule %d)\n", -*rp);
|
||||
fprintf (stderr, " (rule %d)\n", -*rp - 1);
|
||||
}
|
||||
fputs ("\n\n", stderr);
|
||||
}
|
||||
@@ -100,8 +100,8 @@ print_fderives (void)
|
||||
if (BITISSET (FDERIVES (i), j))
|
||||
{
|
||||
short *rhsp;
|
||||
fprintf (stderr, "\t\t%d:", j);
|
||||
for (rhsp = ritem + rule_table[j].rhs; *rhsp >= 0; ++rhsp)
|
||||
fprintf (stderr, "\t\t%d:", j - 1);
|
||||
for (rhsp = &ritem[rule_table[j].rhs]; *rhsp >= 0; ++rhsp)
|
||||
fprintf (stderr, " %s", tags[*rhsp]);
|
||||
fputc ('\n', stderr);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ print_derives (void)
|
||||
{
|
||||
short *rhsp;
|
||||
fprintf (stderr, "\t\t%d:", *sp);
|
||||
for (rhsp = ritem + rule_table[*sp].rhs; *rhsp >= 0; ++rhsp)
|
||||
for (rhsp = &ritem[rule_table[*sp].rhs]; *rhsp >= 0; ++rhsp)
|
||||
fprintf (stderr, " %s", tags[*rhsp]);
|
||||
fprintf (stderr, " (rule %d)\n", -*rhsp - 1);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ ritem_print (FILE *out)
|
||||
if (ritem[i] >= 0)
|
||||
fprintf (out, " %s", tags[ritem[i]]);
|
||||
else
|
||||
fprintf (out, " (rule %d)\n", -ritem[i]);
|
||||
fprintf (out, " (rule %d)\n", -ritem[i] - 1);
|
||||
fputs ("\n\n", out);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user