]> git.saurik.com Git - bison.git/blobdiff - src/bison.simple
* src/bison.simple (yyparse): When reporting verbosely an error,
[bison.git] / src / bison.simple
index bca1254a56e43db3045e2d989dc408795d88be1c..98fa0c4bdaeec1bbf2d8b6df48ddd02d214d8bf6 100644 (file)
@@ -671,30 +671,29 @@ yyerrlab:
          int x, count;
 
          count = 0;
-         /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-         for (x = (yyn < 0 ? -yyn : 0);
+         /* Start X at -YYN if negative to avoid negative indexes in
+            YYCHECK.  */
+         for (x = yyn < 0 ? -yyn : 0;
               x < (int) (sizeof (yytname) / sizeof (char *)); x++)
            if (yycheck[x + yyn] == x)
              size += strlen (yytname[x]) + 15, count++;
-         size += strlen ("parse error, unexpected `") + 1;
+         size += strlen ("parse error, unexpected ") + 1;
          size += strlen (yytname[YYTRANSLATE (yychar)]);
          msg = (char *) malloc (size);
          if (msg != 0)
            {
-             strcpy (msg, "parse error, unexpected `");
+             strcpy (msg, "parse error, unexpected ");
              strcat (msg, yytname[YYTRANSLATE (yychar)]);
-             strcat (msg, "'");
 
              if (count < 5)
                {
                  count = 0;
-                 for (x = (yyn < 0 ? -yyn : 0);
+                 for (x = yyn < 0 ? -yyn : 0;
                       x < (int) (sizeof (yytname) / sizeof (char *)); x++)
                    if (yycheck[x + yyn] == x)
                      {
-                       strcat (msg, count == 0 ? ", expecting `" : " or `");
+                       strcat (msg, count == 0 ? ", expecting " : " or ");
                        strcat (msg, yytname[x]);
-                       strcat (msg, "'");
                        count++;
                      }
                }
@@ -702,7 +701,7 @@ yyerrlab:
              free (msg);
            }
          else
-           yyerror ("parse error; also virtual memory exceeded");
+           yyerror ("parse error; also virtual memory exhausted");
        }
       else
 #endif /* YYERROR_VERBOSE */