]> git.saurik.com Git - bison.git/blobdiff - tests/glr-regression.at
Regenerate.
[bison.git] / tests / glr-regression.at
index a36de9e27d31008320a53ab042bc4908695ded95..9e3cec79df4c4dd413862bc548faa12d235ac5b6 100644 (file)
@@ -972,7 +972,7 @@ AT_DATA_GRAMMAR([glr-regr12.y],
 start:
   alt1 %dprec 1
   | alt2 %dprec 2
-  ; 
+  ;
 
 alt1:
   PARENT_RHS_AFTER {
@@ -1547,7 +1547,7 @@ yyerror (char const *msg)
 static int
 yylex (void)
 {
-  static const char *input = "ab";
+  static char const *input = "ab";
   if (*input == 'b')
     lookahead_value = 1;
   return *input++;
@@ -1606,17 +1606,22 @@ AT_DATA_GRAMMAR([glr-regr17.y],
 
 %%
 
+/* Tests the case of an empty RHS that has inherited the location of the
+   previous nonterminal, which is unresolved.  That location is reported as the
+   last position of the ambiguity.  */
+start: ambig1 empty1 | ambig2 empty2 ;
+
 /* Tests multiple levels of yyresolveLocations recursion.  */
-start: ambig1 | ambig2 ;
 ambig1: sub_ambig1 | sub_ambig2 ;
 ambig2: sub_ambig1 | sub_ambig2 ;
 
-/* Tests non-empty RHS as well as empty RHS with either initial location or
-   location of previous token.  Both empty RHS locations are printed in the
-   error message.  */
-sub_ambig1: empty 'a' 'b' empty ;
-sub_ambig2: empty 'a' 'b' empty ;
-empty: ;
+/* Tests the case of a non-empty RHS as well as the case of an empty RHS that
+   has inherited the initial location.  The empty RHS's location is reported as
+   the first position in the ambiguity.  */
+sub_ambig1: empty1 'a' 'b' ;
+sub_ambig2: empty2 'a' 'b' ;
+empty1: ;
+empty2: ;
 
 %%
 
@@ -1627,11 +1632,12 @@ yyerror (YYLTYPE *locp, char const *msg)
           locp->first_column, locp->last_line, locp->last_column, msg);
 }
 
-/*ARGSUSED*/ static int
+static int
 yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
 {
-  static const char input[] = "ab";
-  static const char *inputp = input;
+  static char const input[] = "ab";
+  static char const *inputp = input;
+  lvalp->dummy = 0;
   llocp->first_line = llocp->last_line = 2;
   llocp->first_column = inputp - input + 1;
   llocp->last_column = llocp->first_column + 1;