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

@@ -662,7 +662,7 @@ b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype));
]b4_locations_if([ YY_LOCATION_PRINT (yyo, *yylocationp);
YYFPRINTF (yyo, ": ");