mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
parser: deprecate %nterm
It has several weaknesses. Reported by Rici Lake. http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00000.html * src/scan-gram.l: here.
This commit is contained in:
@@ -240,7 +240,6 @@ eqopt ([[:space:]]*=)?
|
||||
"%no-lines" return PERCENT_NO_LINES;
|
||||
"%nonassoc" return PERCENT_NONASSOC;
|
||||
"%nondeterministic-parser" return PERCENT_NONDETERMINISTIC_PARSER;
|
||||
"%nterm" return PERCENT_NTERM;
|
||||
"%output" return PERCENT_OUTPUT;
|
||||
"%param" RETURN_PERCENT_PARAM(both);
|
||||
"%parse-param" RETURN_PERCENT_PARAM(parse);
|
||||
@@ -260,7 +259,7 @@ eqopt ([[:space:]]*=)?
|
||||
"%verbose" return PERCENT_VERBOSE;
|
||||
"%yacc" return PERCENT_YACC;
|
||||
|
||||
/* deprecated */
|
||||
/* Deprecated since Bison 2.7.90, 2012. */
|
||||
"%default"[-_]"prec" DEPRECATED("%default-prec");
|
||||
"%error"[-_]"verbose" DEPRECATED("%define parse.error verbose");
|
||||
"%expect"[-_]"rr" DEPRECATED("%expect-rr");
|
||||
@@ -273,6 +272,12 @@ eqopt ([[:space:]]*=)?
|
||||
"%pure"[-_]"parser" DEPRECATED("%pure-parser");
|
||||
"%token"[-_]"table" DEPRECATED("%token-table");
|
||||
|
||||
"%nterm" {
|
||||
/* Deprecated since Bison 3.3, but was a rather stealth feature. */
|
||||
deprecated_directive (loc, yytext, "%type");
|
||||
return PERCENT_NTERM;
|
||||
}
|
||||
|
||||
"%"{id} {
|
||||
complain (loc, complaint, _("invalid directive: %s"), quote (yytext));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user