c: use yysymbol_name in traces

Only parse.error verbose and simple will get the original yytname: the
other options will rely on a different table.  So let's move on top of
the yysymbol_name function.

* data/skeletons/c.m4 (yy_symbol_print): Use yysymbol_name.
* data/skeletons/glr.c (yytokenName): Rename as...
(yysymbol_name): this.
The change of naming scheme is unfortunate, but it's definitely glr.c
which is "wrong".
This commit is contained in:
Akim Demaille
2020-01-16 19:20:13 +01:00
parent e5a5da16ed
commit 8e6233353f
3 changed files with 9 additions and 9 deletions

View File

@@ -1121,7 +1121,7 @@ static void
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
{
YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype));
YY_LOCATION_PRINT (yyo, *yylocationp);
YYFPRINTF (yyo, ": ");