mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
Generalize the display of semantic values and locations in traces.
* data/glr.c (yy_reduce_print): Fix indices (again). * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect literal integers. * data/lalr1.cc (yyreduce_print): Rename as... (yy_reduce_print): this. Display values and locations. * data/yacc.c (yy_reduce_print): Likewise. (YY_REDUCE_PRINT): Adjust to pass the required arguments. (yysymprint): Move higher to be visible from yy_reduce_print). (yyparse): Adjust. * tests/calc.at: Adjust the expected length of the traces.
This commit is contained in:
@@ -1387,8 +1387,8 @@ yy_reduce_print (yyGLRStack* yystack, size_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
yysymprint (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&]b4_rhs_value(yynrhs, yyi - 1)[
|
||||
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi - 1))[]dnl
|
||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user