mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Don't let %prec take a nonterminal.
* src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a token. * tests/input.at (%prec takes a token): New test checking that %prec won't take a nonterminal.
This commit is contained in:
@@ -387,6 +387,7 @@ grammar_midrule_action (void)
|
||||
void
|
||||
grammar_current_rule_prec_set (symbol *precsym, location loc)
|
||||
{
|
||||
symbol_class_set (precsym, token_sym, loc, false);
|
||||
if (current_rule->ruleprec)
|
||||
complain_at (loc, _("only one %s allowed per rule"), "%prec");
|
||||
current_rule->ruleprec = precsym;
|
||||
|
||||
Reference in New Issue
Block a user