mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 21:33:04 +00:00
fixits: be sure to preserve the action when adding %empty
Currently we remove the rhs to install %empty instead. * src/reader.c (grammar_rule_check_and_complete): Insert the missing %empty in front of the rhs, not in replacement thereof. * tests/actions.at (Add missing %empty): Check that.
This commit is contained in:
@@ -357,9 +357,10 @@ grammar_rule_check_and_complete (symbol_list *r)
|
||||
&& !r->percent_empty_loc.start.file
|
||||
&& warning_is_enabled (Wempty_rule))
|
||||
{
|
||||
complain (&r->rhs_loc, Wempty_rule,
|
||||
_("empty rule without %%empty"));
|
||||
fixits_register (&r->rhs_loc, " %empty ");
|
||||
complain (&r->rhs_loc, Wempty_rule, _("empty rule without %%empty"));
|
||||
location loc = r->rhs_loc;
|
||||
loc.end = loc.start;
|
||||
fixits_register (&loc, " %empty ");
|
||||
}
|
||||
|
||||
/* See comments in grammar_current_rule_prec_set for how POSIX
|
||||
|
||||
Reference in New Issue
Block a user