]> git.saurik.com Git - bison.git/blobdiff - tests/regression.at
tests: AT_YYERROR_DEFINE: prepare for list of ints.
[bison.git] / tests / regression.at
index 4208153a37bd99446d38834861f27c5a0b005c61..a5e0c14d82d91947c1fbbb5781360148b5667cf6 100644 (file)
@@ -910,6 +910,7 @@ yyparse ()
 }
 ])
 
+#include <assert.h>
 static int
 yylex (AT_LALR1_CC_IF([int *lval], [void]))
 [{
@@ -919,8 +920,7 @@ yylex (AT_LALR1_CC_IF([int *lval], [void]))
     };
   static size_t toknum;
   ]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC.  */])[
-  if (! (toknum < sizeof tokens / sizeof *tokens))
-    abort ();
+  assert (toknum < sizeof tokens / sizeof *tokens);
   return tokens[toknum++];
 }]
 
@@ -995,6 +995,7 @@ yyparse ()
 }
 ])[
 
+#include <assert.h>
 static int
 yylex (]AT_LALR1_CC_IF([int *lval], [void])[)
 {
@@ -1004,8 +1005,7 @@ yylex (]AT_LALR1_CC_IF([int *lval], [void])[)
     };
   static size_t toknum;
   ]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC.  */])[
-  if (! (toknum < sizeof tokens / sizeof *tokens))
-    abort ();
+  assert (toknum < sizeof tokens / sizeof *tokens);
   return tokens[toknum++];
 }
 
@@ -1312,7 +1312,7 @@ syntax_error:
 /* Induce two syntax error messages (which requires full error
    recovery by shifting 3 tokens) in order to detect any loss of the
    reallocated buffer.  */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
 int
 main (void)
 {
@@ -1419,7 +1419,7 @@ syntax_error2:
 ]AT_YYERROR_DEFINE[
 /* Induce two syntax error messages (which requires full error
    recovery by shifting 3 tokens).  */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
 int
 main (void)
 {
@@ -1569,7 +1569,7 @@ A: /*empty*/ | 'a' ;
 
 %%
 ]AT_YYERROR_DEFINE[
-]AT_YYLEX_DEFINE([$1])[
+]AT_YYLEX_DEFINE(["$1"])[
 int
 main (void)
 {