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:
Joel E. Denny
2009-12-30 03:20:11 -05:00
parent 505e155199
commit 8bb3a2e7df
4 changed files with 62 additions and 0 deletions

10
NEWS
View File

@@ -232,6 +232,16 @@ Bison News
* Changes in version 2.4.2 (????-??-??):
** `%prec IDENTIFIER' requires IDENTIFIER to be defined separately.
POSIX specifies that an error be reported for any identifier that does
not appear on the LHS of a grammar rule and that is not defined by
%token, %left, %right, or %nonassoc. Bison 2.3b and later lost this
error report for the case when an identifier appears only after a
%prec directive. It is now restored. However, for backward
compatibility with recent Bison releases, it is only a warning for
now. In Bison 2.5 and later, it will return to being an error.
** Detection of GNU M4 1.4.6 or newer during configure is improved.
** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,