* data/glr.c (yytnamerr): New function.

(yyreportSyntaxError): Use it to dequote most string literals.
* data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
with other skeletons.  All uses changed.
(yytnameerr_): New function.
(yyreport_syntax_error): Use it to dequote most string literals.
* data/yacc.c (yytnamerr): New function.
(yyerrlab): Use it to decode most string literals.
* doc/bison.texinfo (Decl Summary, Calling Convention):
Clarify quoting convention of yytname.
* src/output.c (prepare_symbols): Quote all names.  This undoes
the 2005-04-17 change, which is now accomplished (mostly) via
changes in the parsers as described above.
* tests/regression.at (Token definitions, Web2c Actions):
Undo most 2005-04-17 change here, too.
This commit is contained in:
Paul Eggert
2005-07-21 20:53:03 +00:00
parent 49b1cf794d
commit 9e0876fb0c
6 changed files with 182 additions and 43 deletions

View File

@@ -60,7 +60,7 @@ bool error_verbose = false;
#define GENERATE_MUSCLE_INSERT_TABLE(Name, Type) \
\
static void \
Name (const char *name, \
Name (char const *name, \
Type *table_data, \
Type first, \
int begin, \
@@ -162,10 +162,7 @@ prepare_symbols (void)
int j = 2;
for (i = 0; i < nsyms; i++)
{
char const *tag = symbols[i]->tag;
char const *cp = (*tag == '"'
? tag
: quotearg_style (c_quoting_style, tag));
char const *cp = quotearg_style (c_quoting_style, symbols[i]->tag);
/* Width of the next token, including the two quotes, the
comma and the space. */
int width = strlen (cp) + 2;