news: update the yyreport_syntax_error example

* examples/c/bistromathic/parse.y, tests/local.at
(yyreport_syntax_error): Fix use of YYSYMBOL_YYEMPTY.
* NEWS: Update.
This commit is contained in:
Akim Demaille
2020-04-04 19:35:33 +02:00
parent 4e3c06b0f8
commit 225a67321b
3 changed files with 27 additions and 15 deletions

View File

@@ -634,7 +634,7 @@ yyreport_syntax_error (const yypcontext_t *ctx]AT_PARAM_IF([, AT_PARSE_PARAMS])[
fprintf (stderr, "syntax error");
{
yysymbol_type_t la = yypcontext_token (ctx);
if (la != YYEMPTY)
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
@@ -642,9 +642,9 @@ yyreport_syntax_error (const yypcontext_t *ctx]AT_PARAM_IF([, AT_PARSE_PARAMS])[
yysymbol_type_t expected[TOKENMAX];
int n = yyexpected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n < 0)
if (n <= 0)
res = n;
else if (0 < n)
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)