]> git.saurik.com Git - bison.git/blobdiff - tests/calc.at
(Badly Collapsed GLR States): Avoid //
[bison.git] / tests / calc.at
index 82674c10071fd25184c6f575230cbc66430e4555..aff3b455fc9e0c1bf08a90331d4e8c6538a56e67 100644 (file)
@@ -100,9 +100,9 @@ static int power (int base, int exponent);
 /* yyerror receives the location if:
    - %location & %pure & %glr
    - %location & %pure & %yacc & %parse-param. */
-static void yyerror (const char *s
-                     ]AT_YYERROR_ARG_LOC_IF([, YYLTYPE *yylloc])[
-                     ]AT_PARAM_IF([, value_t *result, int *count])[
+static void yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[
+                     ]AT_PARAM_IF([value_t *result, int *count, ])[
+                     const char *s
                      );
 static int yylex (LEX_FORMALS);
 static int yygetc (LEX_FORMALS);
@@ -154,10 +154,12 @@ exp:
 FILE *yyin;
 
 static void
-yyerror (const char *s
-         ]AT_YYERROR_ARG_LOC_IF([, YYLTYPE *yylloc])[
-         ]AT_PARAM_IF([, value_t *result, int *count])[)
+yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[
+         ]AT_PARAM_IF([value_t *result, int *count, ])[
+         const char *s
+         )
 {
+]AT_PARAM_IF([(void) result; (void) count; ])[
 ]AT_YYERROR_SEES_LOC_IF([
   fprintf (stderr, "%d.%d-%d.%d: ",
           LOC.first_line, LOC.first_column,
@@ -441,10 +443,11 @@ m4_pushdef([AT_GLR_OR_PARAM_IF],
 m4_pushdef([AT_YYERROR_ARG_LOC_IF],
 [AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
                     [$2])])
-# yyerror cannot see the locations if !glr & pure.
+# yyerror cannot see the locations if !glr & pure & !param.
 m4_pushdef([AT_YYERROR_SEES_LOC_IF],
 [AT_LOCATION_IF([AT_GLR_IF([$1],
-                           [AT_PURE_IF([$2], [$1])])],
+                           [AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
+                                       [$1])])],
                 [$2])])
 ])