mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +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:
@@ -222,7 +222,7 @@ static const short yyprhs[] =
|
||||
%%prhs
|
||||
};
|
||||
|
||||
/* YYRHS -- A `0'-separated list of the rules' RHS. */
|
||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
||||
static const short yyrhs[] =
|
||||
{
|
||||
%%rhs
|
||||
@@ -899,10 +899,10 @@ yyreduce:
|
||||
int yyi;
|
||||
|
||||
YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
|
||||
yyn, yyrline[yyn]);
|
||||
yyn - 1, yyrline[yyn]);
|
||||
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
|
||||
for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
|
||||
YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
|
||||
YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user