mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
POSIX: complain if %prec's token was not defined.
* NEWS (2.5): Document.
* src/reader.c (grammar_rule_check): Convert warning to
complaint.
* tests/input.at (%prec's token must be defined): Update.
(cherry picked from commit 510df9519e)
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2009-12-30 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
|
POSIX: complain if %prec's token was not defined.
|
||||||
|
* NEWS (2.5): Document.
|
||||||
|
* src/reader.c (grammar_rule_check): Convert warning to
|
||||||
|
complaint.
|
||||||
|
* tests/input.at (%prec's token must be defined): Update.
|
||||||
|
|
||||||
2009-12-30 Joel E. Denny <jdenny@clemson.edu>
|
2009-12-30 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
POSIX: warn if %prec's token was not defined.
|
POSIX: warn if %prec's token was not defined.
|
||||||
|
|||||||
6
NEWS
6
NEWS
@@ -180,6 +180,12 @@ Bison News
|
|||||||
discussion of how to suppress C preprocessor warnings about YYFAIL
|
discussion of how to suppress C preprocessor warnings about YYFAIL
|
||||||
being unused, see the Bison 2.4.2 NEWS entry.
|
being unused, see the Bison 2.4.2 NEWS entry.
|
||||||
|
|
||||||
|
** `%prec IDENTIFIER' requires IDENTIFIER to be defined separately.
|
||||||
|
|
||||||
|
As promised in Bison 2.4.2's NEWS entry, it is now an error if a token
|
||||||
|
that appears after a %prec directive is not defined by %token, %left,
|
||||||
|
%right, or %nonassoc. This is required by POSIX.
|
||||||
|
|
||||||
** Temporary hack for adding a semicolon to the user action.
|
** Temporary hack for adding a semicolon to the user action.
|
||||||
|
|
||||||
Previously, Bison appended a semicolon to every user action for
|
Previously, Bison appended a semicolon to every user action for
|
||||||
|
|||||||
@@ -327,8 +327,8 @@ grammar_rule_check (const symbol_list *r)
|
|||||||
if (r->ruleprec
|
if (r->ruleprec
|
||||||
&& r->ruleprec->tag[0] != '\'' && r->ruleprec->tag[0] != '"'
|
&& r->ruleprec->tag[0] != '\'' && r->ruleprec->tag[0] != '"'
|
||||||
&& !r->ruleprec->declared && !r->ruleprec->prec)
|
&& !r->ruleprec->declared && !r->ruleprec->prec)
|
||||||
warn_at (r->location, _("token for %%prec is not defined: %s"),
|
complain_at (r->location, _("token for %%prec is not defined: %s"),
|
||||||
r->ruleprec->tag);
|
r->ruleprec->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -807,8 +807,8 @@ AT_DATA([[input.y]],
|
|||||||
start: %prec PREC ;
|
start: %prec PREC ;
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], [[0]], [],
|
AT_BISON_CHECK([[input.y]], [[1]], [],
|
||||||
[[input.y:2.8-17: warning: token for %prec is not defined: PREC
|
[[input.y:2.8-17: token for %prec is not defined: PREC
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|||||||
Reference in New Issue
Block a user