mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
* 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:
@@ -324,9 +324,9 @@ int yylex (void);
|
||||
%token B_TOKEN "b"
|
||||
%token C_TOKEN 'c'
|
||||
%token 'd' D_TOKEN
|
||||
%token SPECIAL "\\\'\?\"\n\t??!"
|
||||
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff??!"
|
||||
%%
|
||||
exp: "a" "\\\'\?\"\n\t??!";
|
||||
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff??!";
|
||||
%%
|
||||
void
|
||||
yyerror (char const *s)
|
||||
@@ -350,8 +350,7 @@ main (void)
|
||||
AT_CHECK([bison -o input.c input.y])
|
||||
AT_COMPILE([input])
|
||||
AT_PARSER_CHECK([./input], 1, [],
|
||||
[syntax error, unexpected \'?"
|
||||
??!, expecting a
|
||||
[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\377\001\377?\?!", expecting a
|
||||
])
|
||||
AT_CLEANUP
|
||||
|
||||
@@ -635,8 +634,8 @@ static const unsigned char yyrline[] =
|
||||
};
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
"$end", "error", "$undefined", "if", "const", "then", "else", "$accept",
|
||||
"statement", "struct_stat", "if", "else", 0
|
||||
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
|
||||
"\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
|
||||
};
|
||||
static const unsigned short int yytoknum[] =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user