mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
* src/output.c (output_gram): Rely on nritems, not the
0-sentinel. See below. Use -1 as separator, not 0. * src/bison.simple (yyparse): Subtract 1 to the rule numbers. Rely on -1 as separator in yyrhs, instead of 0. * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue twice `Now at end of input', therefore there are two lines less to expect.
This commit is contained in:
13
src/output.c
13
src/output.c
@@ -195,19 +195,16 @@ output_gram (void)
|
||||
muscle_insert ("prhs", obstack_finish (&format_obstack));
|
||||
|
||||
{
|
||||
size_t yyrhs_size = 1;
|
||||
short *yyrhs, *sp;
|
||||
short *yyrhs;
|
||||
int i;
|
||||
|
||||
for (sp = ritem + 1; *sp; sp++)
|
||||
++yyrhs_size;
|
||||
yyrhs = XMALLOC (short, yyrhs_size);
|
||||
yyrhs = XMALLOC (short, nritems);
|
||||
|
||||
for (sp = ritem + 1, i = 1; *sp; ++sp, ++i)
|
||||
yyrhs[i] = *sp >= 0 ? *sp : 0;
|
||||
for (i = 1; i < nritems; ++i)
|
||||
yyrhs[i] = ritem[i] >= 0 ? ritem[i] : -1;
|
||||
|
||||
output_table_data (&format_obstack, yyrhs,
|
||||
ritem[0], 1, yyrhs_size);
|
||||
ritem[0], 1, nritems);
|
||||
muscle_insert ("rhs", obstack_finish (&format_obstack));
|
||||
|
||||
XFREE (yyrhs);
|
||||
|
||||
Reference in New Issue
Block a user