X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ca407bdf9db2d435ca1a4a257b158632d1cb4842..cd8b579166335323fc1c5a59ff7e3e9968d5ec4f:/tests/regression.at?ds=inline diff --git a/tests/regression.at b/tests/regression.at index 3d67ee9d..b1a3d56b 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1,5 +1,7 @@ # Bison Regressions. -*- Autotest -*- -# Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,8 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. AT_BANNER([[Regression tests.]]) @@ -303,6 +305,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 +347,9 @@ int yylex (void); %token B_TOKEN "b" %token C_TOKEN 'c' %token 'd' D_TOKEN -%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff" +%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %% -exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff"; +exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"; %% void yyerror (char const *s) @@ -349,9 +372,10 @@ main (void) AT_CHECK([bison -o input.c input.y]) AT_COMPILE([input]) -AT_PARSER_CHECK([./input], 1, [], -[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\377\001\377", 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 @@ -559,7 +583,7 @@ AT_CLEANUP # # It used to be wrong on yydefact only: # -# static const short int yydefact[] = +# static const yytype_uint8 yydefact[] = # { # - 2, 0, 1, 0, 0, 2, 3, 2, 5, 4, # + 2, 0, 1, 0, 0, 0, 3, 2, 5, 4, @@ -589,7 +613,7 @@ AT_CHECK([bison -v -o input.c input.y]) [sed -n 's/ *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c] AT_CHECK([[cat tables.c]], 0, -[[static const unsigned char yytranslate[] = +[[static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -619,16 +643,16 @@ AT_CHECK([[cat tables.c]], 0, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6 }; -static const unsigned char yyprhs[] = +static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 6, 9, 14 }; -static const yysigned_char yyrhs[] = +static const yytype_int8 yyrhs[] = { 8, 0, -1, 9, -1, -1, 10, 11, -1, 3, 4, 5, 8, -1, 6, 8, -1 }; -static const unsigned char yyrline[] = +static const yytype_uint8 yyrline[] = { 0, 2, 2, 3, 3, 4, 5 }; @@ -637,45 +661,45 @@ static const char *const yytname[] = "$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"", "\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0 }; -static const unsigned short int yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261 }; -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 7, 8, 9, 9, 10, 11 }; -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 0, 2, 4, 2 }; -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 3, 0, 0, 2, 0, 0, 1, 3, 4, 3, 6, 5 }; -static const yysigned_char yydefgoto[] = +static const yytype_int8 yydefgoto[] = { -1, 2, 3, 4, 8 }; -static const yysigned_char yypact[] = +static const yytype_int8 yypact[] = { -2, -1, 4, -8, 0, 2, -8, -2, -8, -2, -8, -8 }; -static const yysigned_char yypgoto[] = +static const yytype_int8 yypgoto[] = { -8, -7, -8, -8, -8 }; -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { 10, 1, 11, 5, 6, 0, 7, 9 }; -static const yysigned_char yycheck[] = +static const yytype_int8 yycheck[] = { 7, 3, 9, 4, 0, -1, 6, 5 }; -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 3, 8, 9, 10, 4, 0, 6, 11, 5, 8, 8