AT_CLEANUP
+AT_SETUP([Invalid inputs with {}])
+
+AT_DATA([input.y],
+[[
+%destructor
+%initial-action
+%lex-param
+%parse-param
+%printer
+%union
+]])
+
+AT_CHECK([bison input.y], [1], [],
+[[input.y:3.1: missing `{' in "%destructor {...}"
+input.y:4.1: missing `{' in "%initial-action {...}"
+input.y:4.1: syntax error, unexpected %initial-action {...}, expecting string or identifier
+]])
+
+AT_CLEANUP
+
+
## ------------------- ##
## Token definitions. ##
%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\201\x001\x000081??!"
%%
-exp: "a" "\\\'\?\"\n\t??!";
+exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
%%
void
yyerror (char const *s)
AT_CHECK([bison -o input.c input.y])
AT_COMPILE([input])
-AT_PARSER_CHECK([./input], 1, [],
-[syntax error, unexpected \'?"
- ??!, expecting a
-])
+AT_DATA([experr],
+[[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201?\?!", expecting a
+]])
+AT_PARSER_CHECK([./input], 1, [], [experr])
AT_CLEANUP
};
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[] =
{