mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
POSIX: warn if %prec's token was not defined.
Reported by Florian Krohm at
<http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
* NEWS (2.4.2): Document.
* src/reader.c (grammar_rule_check): Implement.
(grammar_current_rule_prec_set): Add comments explaining that we
here assume a %prec identifier is a token, but we still manage
to support POSIX.
* tests/input.at (%prec's token must be defined): New test
group.
(cherry picked from commit f1ceed0774)
This commit is contained in:
@@ -794,6 +794,26 @@ AT_BISON_CHECK([input.y], [1], [],
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------- ##
|
||||
## %prec's token must be defined. ##
|
||||
## ------------------------------- ##
|
||||
|
||||
AT_SETUP([[%prec's token must be defined]])
|
||||
|
||||
# According to POSIX, a %prec token must be defined separately.
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%%
|
||||
start: %prec PREC ;
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([[input.y]], [[0]], [],
|
||||
[[input.y:2.8-17: warning: token for %prec is not defined: PREC
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## -------------------------------- ##
|
||||
## Reject unused %code qualifiers. ##
|
||||
## -------------------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user