mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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:
@@ -61,7 +61,7 @@ m4_define([b4_lhs_value],
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
m4_define([b4_rhs_value],
|
||||
[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
|
||||
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
@@ -75,7 +75,7 @@ m4_define([b4_lhs_location],
|
||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[(yylocation_stack_@{m4_eval([$1 - $2])@})])
|
||||
[(yylocation_stack_@{($1) - ($2)@})])
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
|
||||
Reference in New Issue
Block a user