X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0fb669f9d648dfdd7a39478a6b658511455ae966..3b0ffc7ec1c9f452b48150c5c537b4f2b80cd34e:/tests/regression.at diff --git a/tests/regression.at b/tests/regression.at index fe7c31b4..eb85f290 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -303,6 +303,27 @@ input.y:7.1-8.0: missing `%}' at end of file 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. ## @@ -324,9 +345,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\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) @@ -349,10 +370,10 @@ main (void) 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 @@ -635,8 +656,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[] = {