all: don't emit an error message when the scanner returns YYERRCODE

I'm quite pleased to see that the tricky case of glr.c was already
prepared by the changes to support syntax_error exceptions.  Better
yet, it is actually syntax_error that becomes a special case of the
general pattern: make yytoken be YYERRCODE.

* data/skeletons/glr.c (YYFAULTYTOK): Remove the now useless (Basil)
Faulty token.
Instead, use the error token.
* data/skeletons/lalr1.d, data/skeletons/lalr1.java: When computing
the action, first check the case of the error token.

* tests/calc.at: Check cases for the error token symbols before and
after it.
This commit is contained in:
Akim Demaille
2020-04-26 14:48:59 +02:00
parent 58e79539fc
commit b254b36db8
6 changed files with 121 additions and 76 deletions

View File

@@ -1963,9 +1963,8 @@ yyerrlab:
goto yyexhaustedlab;
}]])[
}
]b4_locations_if([[ yyerror_range[1] = yylloc;]])[
]b4_locations_if([[
yyerror_range[1] = yylloc;]])[
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an