Reported by Rici Lake.
http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html
http://stackoverflow.com/questions/
19330171/
* src/scan-gram.l: Do not try to be too smart when diagnosing invalid
directives.
* tests/glr-regression.at (Predicates): New test.
leaves "foo" diagnostics as warnings. Similarly, with "-Werror=foo
-Wno-error", "foo" diagnostics are now errors.
+*** GLR Predicates
+
+ As demonstrated in the documentation, one can now leave spaces between
+ "%?" and its "{".
+
* Noteworthy changes in release 3.0 (2013-07-25) [stable]
** WARNING: Future backward-incompatibilities!
Raja R Harinath harinath@cs.umn.edu
Ralf Wildenhues Ralf.Wildenhues@gmx.de
Richard Stallman rms@gnu.org
+Rici Lake ricilake@gmail.com
Rob Vermaas rob.vermaas@gmail.com
Robert Anisko anisko_r@epita.fr
Rob Conde rob.conde@ai-solutions.com
"%pure"[-_]"parser" DEPRECATED("%pure-parser");
"%token"[-_]"table" DEPRECATED("%token-table");
- "%"{id}|"%"{notletter}([[:graph:]])+ {
+ "%"{id} {
complain (loc, complaint, _("invalid directive: %s"), quote (yytext));
}
])
AT_CLEANUP
+
+
+## ----------------------------------------------------------------- ##
+## Predicates. ##
+## ##
+## http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html ##
+## ----------------------------------------------------------------- ##
+
+AT_SETUP([Predicates])
+
+# FIXME: We need genuine test cases with uses of %?.
+
+AT_DATA_GRAMMAR([input.y],
+[[%glr-parser
+%expect-rr 1
+%%
+// Exercise "%?{...}" and "%? {...}".
+widget:
+ %? {new_syntax} "widget" id new_args { $$ = f($3, $4); }
+| %?{!new_syntax} "widget" id old_args { $$ = f($3, $4); }
+;
+id:;
+new_args:;
+old_args:;
+%%
+]])
+
+AT_BISON_CHECK([[input.y]])
+
+AT_CLEANUP