]> git.saurik.com Git - bison.git/blobdiff - data/glr.c
tests: minor fixes/simplifications
[bison.git] / data / glr.c
index 9a3dbc8d2dc99c65d46610c48da2fb7d800bf5f2..148af2b69d9cf696ff06244304c77ab9bb9bb3e1 100644 (file)
@@ -852,8 +852,8 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
   yybool yynormal __attribute__ ((__unused__)) =
     (yystackp->yysplitPoint == NULL);
   int yylow;
-]b4_parse_param_use[]dnl
-[# undef yyerrok
+]b4_parse_param_use([yyvalp], [yylocp])[
+# undef yyerrok
 # define yyerrok (yystackp->yyerrState = 0)
 # undef YYACCEPT
 # define YYACCEPT return yyaccept
@@ -1330,8 +1330,7 @@ yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk,
   int yynrhs = yyrhsLength (yyrule);]b4_locations_if([
   int yylow = 1;])[
   int yyi;
-]b4_parse_param_use[]dnl
-[  YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
+  YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
              (unsigned long int) yyk, yyrule - 1,
              (unsigned long int) yyrline[yyrule]);
   if (! yynormal)
@@ -1728,10 +1727,10 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
         {
           if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
             YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
-                       yytokenName (yystos[yystates[yyi-1]->yylrState]));
+                       yytokenName (yystos[yystates[yyi]->yylrState]));
           else
             YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
-                       yytokenName (yystos[yystates[yyi-1]->yylrState]),
+                       yytokenName (yystos[yystates[yyi]->yylrState]),
                        (unsigned long int) (yystates[yyi-1]->yyposn + 1),
                        (unsigned long int) yystates[yyi]->yyposn);
         }