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:
@@ -680,3 +680,24 @@ start: false_start ;
|
||||
AT_CHECK([bison -o input.c input.y])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## --------------------- ##
|
||||
## %prec takes a token. ##
|
||||
## --------------------- ##
|
||||
|
||||
AT_SETUP([%prec takes a token])
|
||||
|
||||
# Bison once allowed %prec sym where sym was a nonterminal.
|
||||
|
||||
AT_DATA([input.y],
|
||||
[[%%
|
||||
start: PREC %prec PREC ;
|
||||
PREC: ;
|
||||
]])
|
||||
|
||||
AT_CHECK([bison input.y], [1], [],
|
||||
[[input.y:3.1-4: rule given for PREC, which is a token
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user