]> git.saurik.com Git - bison.git/blobdiff - tests/cxx-type.at
(Badly Collapsed GLR States): Avoid //
[bison.git] / tests / cxx-type.at
index 25abfd5b416944b0858c5f1b9f4853317284bb9c..b63b2dd380eb5c2a0f9f0d1a22956dc7d8ab3b12 100644 (file)
@@ -36,7 +36,12 @@ $1
 ]m4_bmatch([$2], [stmtMerge],
 [ static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);])[
   #define YYINITDEPTH 10
-  int yyerror (const char *s);
+  int yyerror (
+#if YYPURE && YYLSP_NEEDED
+               YYLTYPE *yylocation,
+#endif
+               const char *s
+              );
 
   #if YYPURE
 ]m4_bmatch([$1], [location],
@@ -130,7 +135,7 @@ yylex ()
          break;
        default:
          if (isalpha (c))
-           { 
+           {
              i = 0;
 
              do
@@ -153,8 +158,16 @@ yylex ()
 }
 
 int
-yyerror (const char *s)
+yyerror (
+#if YYPURE && YYLSP_NEEDED
+         YYLTYPE *yylocation,
+#endif
+         const char *s
+        )
 {
+#if YYPURE && YYLSP_NEEDED
+  (void) *yylocation;
+#endif
   fprintf (stderr, "%s\n", s);
   return 0;
 }
@@ -241,62 +254,56 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
 
 AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CALC([],[%dprec 1],[%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
-        _AT_GLR_STDERR)
+AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+                _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, impure, locations])
 _AT_TEST_GLR_CALC([%locations],[%dprec 1],[%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
-       _AT_GLR_STDERR)
+AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+                _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
 _AT_TEST_GLR_CALC([%pure-parser],[%dprec 1],[%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
-        _AT_GLR_STDERR)
+AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+                _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, locations])
 _AT_TEST_GLR_CALC([%pure-parser
 %locations],[%dprec 1],[%dprec 2])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-                _AT_RESOLVED_GLR_OUTPUT,
-               _AT_GLR_STDERR)
+                _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
 _AT_TEST_GLR_CALC([],[%merge <stmtMerge>],[%merge <stmtMerge>])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-                _AT_AMBIG_GLR_OUTPUT,
-               _AT_GLR_STDERR)
+                _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, locations])
 _AT_TEST_GLR_CALC([%locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-                _AT_AMBIG_GLR_OUTPUT,
-               _AT_GLR_STDERR)
+                _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
 _AT_TEST_GLR_CALC([%pure-parser],[%merge <stmtMerge>],[%merge <stmtMerge>])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-                _AT_AMBIG_GLR_OUTPUT,
-               _AT_GLR_STDERR)
+                _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 AT_SETUP([GLR: Merge conflicting parses, pure, locations])
 _AT_TEST_GLR_CALC([%pure-parser
 %locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-                _AT_AMBIG_GLR_OUTPUT,
-               _AT_GLR_STDERR)
+                _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CALC([%error-verbose],
 [%merge <stmtMerge>],[%merge <stmtMerge>])
 AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
-               _AT_AMBIG_GLR_OUTPUT,
-                _AT_VERBOSE_GLR_STDERR)
+               _AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
 AT_CLEANUP