]> git.saurik.com Git - bison.git/blobdiff - tests/regression.at
Don't apply the default %destructor or %printer to the error token,
[bison.git] / tests / regression.at
index 70133797dbe5871d3330288b5cd87229023e7e56..36b95eb102c3e89241243038c8fe22b18b902e5f 100644 (file)
@@ -398,6 +398,7 @@ input.y:5.1-17: invalid directive: `%a-does-not-exist'
 input.y:6.1: invalid character: `%'
 input.y:6.2: invalid character: `-'
 input.y:7.1-8.0: missing `%}' at end of file
+input.y:7.1-8.0: syntax error, unexpected %{...%}
 ]])
 
 AT_CLEANUP
@@ -1107,3 +1108,26 @@ Stack now 0
 ]])
 
 AT_CLEANUP
+
+
+
+## --------------------------------- ##
+## String alias declared after use.  ##
+## --------------------------------- ##
+
+AT_SETUP([String alias declared after use])
+
+# Bison once incorrectly asserted that the symbol number for either a token or
+# its alias was the highest symbol number so far at the point of the alias
+# declaration.  That was true unless the declaration appeared after their first
+# uses and other tokens appeared in between.
+
+AT_DATA([input.y],
+[[%%
+start: 'a' "A" 'b';
+%token 'a' "A";
+]])
+
+AT_CHECK([bison -t -o input.c input.y])
+
+AT_CLEANUP