]> git.saurik.com Git - bison.git/blobdiff - data/glr.c
In verbose parse error message, don't report `error' as an
[bison.git] / data / glr.c
index 660a22433fe5806ddcc32933e4299f9a748d3130..c2fab0b8d3e71e3628d9b1e763eee419c9bc8d44 100644 (file)
@@ -1512,7 +1512,7 @@ yyreportParseError (yyGLRStack* yystack, YYSTYPE* yylvalp, YYLTYPE* yyllocp)
          yyprefix = ", expecting ";
          for (yyx = yyn < 0 ? -yyn : 0; yyx < yytname_size && yycount <= 5;
               yyx += 1)
-           if (yycheck[yyx + yyn] == yyx)
+           if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
              yysize += strlen (yytokenName (yyx)) + strlen (yyprefix),
                yycount += 1, yyprefix = " or ";
          yymsg = yyp = (char*) malloc (yysize);