diff options
author | Joel E. Denny <jdenny@clemson.edu> | 2009-12-21 14:58:48 -0500 |
---|---|---|
committer | Joel E. Denny <jdenny@clemson.edu> | 2009-12-21 16:40:33 -0500 |
commit | 4395a9ff4fd518580b9abe9482783e8eba192f34 (patch) | |
tree | c2f906585b060cf51c3dbf0b236a68f22457235c /src | |
parent | 1625df5b18bc1ad696f149f059e6677ca0759dfc (diff) | |
download | bison-4395a9ff4fd518580b9abe9482783e8eba192f34.tar.gz |
YYFAIL: warn about uses and remove from lalr1.java.
* NEWS (2.5): Document.
* data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
and make it private. Update all uses.
* src/scan-code.l (SC_RULE_ACTION): Implement warning.
Diffstat (limited to 'src')
-rw-r--r-- | src/scan-code.l | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/scan-code.l b/src/scan-code.l index 56cd7825..700488e8 100644 --- a/src/scan-code.l +++ b/src/scan-code.l @@ -246,7 +246,20 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$" {splice} STRING_GROW; [\n\r] STRING_GROW; if (in_cpp) in_cpp = need_semicolon = false; [ \t\f] STRING_GROW; - . STRING_GROW; need_semicolon = true; + + /* YYFAIL is undocumented and was formally deprecated in Bison + 2.4.2. */ + YYFAIL { + STRING_GROW; need_semicolon = true; + warn_at (*loc, _("use of YYFAIL, which is deprecated and will be" + " removed")); + } + + /* The sole purpose of this is to make sure identifiers that merely + contain YYFAIL don't produce the above warning. */ + [A-Za-z_][0-9A-Za-z_]* STRING_GROW; need_semicolon = true; + + . STRING_GROW; need_semicolon = true; } <SC_SYMBOL_ACTION> |