X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/230a3db428622bb964807111b46812879b7ee726..827bc59ca118956fe84309e2ea3db6bfaabf374c:/tests/cxx-type.at diff --git a/tests/cxx-type.at b/tests/cxx-type.at index e172033a..eb11156f 100644 --- a/tests/cxx-type.at +++ b/tests/cxx-type.at @@ -1,6 +1,6 @@ # Checking GLR Parsing. -*- Autotest -*- -# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# Copyright (C) 2002-2015 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 @@ -94,19 +94,19 @@ prog : stmt : expr ';' $2 { $$ = ]$[1; } | decl $3 - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", ]$[3, ]$[1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", ]$[3, ]$[1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", ]$[1, ]$[2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", ]$[1, ]$[2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", ]$[1, ]$[2, ]$[4); } @@ -122,12 +122,12 @@ declarator : ID #include #include #include +#include int main (int argc, char **argv) { - if (argc != 2) - abort (); + assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); @@ -152,8 +152,7 @@ main (int argc, char **argv) while (1) { - if (feof (stdin)) - abort (); + assert (!feof (stdin)); c = getchar (); switch (c) { @@ -182,8 +181,7 @@ main (int argc, char **argv) { buffer[i++] = c; colNum += 1; - if (i == sizeof buffer - 1) - abort (); + assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); @@ -197,7 +195,7 @@ main (int argc, char **argv) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; }]AT_LOCATION_IF([[ yylloc.last_column = colNum-1;]])[ return tok; @@ -289,7 +287,7 @@ m4_bmatch([$2], [stmtMerge], [[static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } ]]) ) @@ -378,7 +376,7 @@ m4_define([_AT_GLR_STDERR], ]]) m4_define([_AT_GLR_STDERR_WITH_LOC], -[[17.5-4: syntax error +[[17.5: syntax error ]]) m4_define([_AT_VERBOSE_GLR_STDERR], @@ -386,7 +384,7 @@ m4_define([_AT_VERBOSE_GLR_STDERR], ]]) m4_define([_AT_VERBOSE_GLR_STDERR_WITH_LOC], -[[17.5-4: syntax error, unexpected ID, expecting '=' or '+' or ')' +[[17.5: syntax error, unexpected ID, expecting '=' or '+' or ')' ]]) ## ---------------------------------------------------- ##