]> git.saurik.com Git - bison.git/blobdiff - tests/cxx-type.at
* NEWS: Version 2.0b.
[bison.git] / tests / cxx-type.at
index 8650a5bd3314ec305b05079ac1343d8915bd75fa..818c8f82bf08026247b30dcdcbbee62691d64c91 100644 (file)
@@ -82,8 +82,8 @@ prog :
 
 stmt : expr ';'  $2    { $$ = ]$[1; }
      | decl      $3
-     | error ';'       { $$ = "<error>"; }
-     | '@'             { YYACCEPT; }
+     | error ';'       { static char error_msg[] = "<error>"; $$ = error_msg; }
+     | '@'             { YYACCEPT; }
      ;
 
 expr : ID
@@ -145,7 +145,7 @@ yylex (LEX_PARAMETERS)
          break;
        case ' ': case '\f':
          colNum += 1;
-         break;
+         break;
        case '\n':
          lineNum += 1;
          colNum = 0;
@@ -178,9 +178,10 @@ yylex (LEX_PARAMETERS)
              }
            else
              {
+               static char empty_string[] = "";
                colNum += 1;
                tok = c;
-               yylval = "";
+               yylval = empty_string;
              }
 #if YYLSP_NEEDED
            yylloc.last_column = colNum-1;
@@ -318,60 +319,60 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
 AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, impure, locations])
 _AT_TEST_GLR_CXXTYPES([%locations],[%dprec 1],[%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser %locations],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, locations])
 _AT_TEST_GLR_CXXTYPES([%locations],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 AT_SETUP([GLR: Merge conflicting parses, pure, locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser %locations],
                       [%merge <stmtMerge>],[%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([%error-verbose],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                _AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
 AT_CLEANUP