]> git.saurik.com Git - bison.git/blobdiff - tests/glr-regression.at
gnulib: update
[bison.git] / tests / glr-regression.at
index 9eb429c77908db9363404a4f840bb300c68074f0..064b37b29ddf7013f5da66dd0b39b2b89850b6b1 100644 (file)
@@ -486,8 +486,8 @@ start:
    ;
 
 %%
-]AT_YYLEX_DEFINE(["a"])[
 ]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE(["a"])[
 ]AT_MAIN_DEFINE[
 ]])
 AT_BISON_OPTION_POPDEFS
@@ -1679,8 +1679,8 @@ start:
 b: 'b';
 d: /* nada.  */;
 %%
-]AT_YYLEX_DEFINE(["abc"])[
 ]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE(["abc"])[
 ]AT_MAIN_DEFINE[
 ]])
 AT_BISON_OPTION_POPDEFS
@@ -1749,3 +1749,33 @@ Cleanup: popping token 'a' ()
 ])
 
 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