mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
* src/reader.c (grammar_current_rule_check): Also check that $$
is used. Take the rule to check as argument, hence rename as... (grammar_rule_check): this. * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end): Rename as... (grammar_rule_begin, grammar_rule_end): these, for consistency. (grammar_midrule_action, grammar_symbol_append): Now static. * tests/torture.at (input): Don't rely on the default action being always performed. * tests/calc.at: "Set" $$ even when the action is "cut" with YYERROR or other. * tests/actions.at (Exotic Dollars): Instead of using unused values, check that the warning is issued.
This commit is contained in:
@@ -815,6 +815,7 @@ handle_action_dollar (char *text, location loc)
|
||||
type_name = "";
|
||||
obstack_fgrow1 (&obstack_for_string,
|
||||
"]b4_lhs_value([%s])[", type_name);
|
||||
current_rule->used = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -837,8 +838,7 @@ handle_action_dollar (char *text, location loc)
|
||||
obstack_fgrow3 (&obstack_for_string,
|
||||
"]b4_rhs_value(%d, %d, [%s])[",
|
||||
rule_length, n, type_name);
|
||||
if (typed)
|
||||
symbol_list_n_used_set (current_rule, n, true);
|
||||
symbol_list_n_used_set (current_rule, n, true);
|
||||
}
|
||||
else
|
||||
complain_at (loc, _("integer out of range: %s"), quote (text));
|
||||
|
||||
Reference in New Issue
Block a user