X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/72f000b088367bd18a20b3e063bc1ab6a3e0bc15..d508c2816f6f0a3f44a1ff5d6526585c10826950:/tests/regression.at diff --git a/tests/regression.at b/tests/regression.at index 9796574f..eb85f290 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -13,8 +13,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 +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[] = {