]> git.saurik.com Git - bison.git/blobdiff - tests/regression.at
Pass the token type to yysyntax_error.
[bison.git] / tests / regression.at
index 51bf3f308dab55311ed766405dba1df56ebf44b7..cf6534607d17b590f32a101967f4a44a9a7c999f 100644 (file)
@@ -1,6 +1,6 @@
 # Bison Regressions.                               -*- Autotest -*-
 
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
 # Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
@@ -393,8 +393,7 @@ input.y:3.14: invalid character: `}'
 input.y:4.1: invalid character: `%'
 input.y:4.2: invalid character: `&'
 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:6.1-2: invalid directive: `%-'
 input.y:7.1-8.0: missing `%}' at end of file
 input.y:7.1-8.0: syntax error, unexpected %{...%}
 ]])
@@ -939,11 +938,7 @@ m4_define([AT_CHECK_DANCER],
 AT_BISON_OPTION_PUSHDEFS([$1])
 _AT_DATA_DANCER_Y([$1])
 AT_BISON_CHECK([-o dancer.c dancer.y])
-AT_LALR1_CC_IF(
-  [AT_BISON_CHECK([-o dancer.cc dancer.y])
-   AT_COMPILE_CXX([dancer])],
-  [AT_BISON_CHECK([-o dancer.c dancer.y])
-   AT_COMPILE([dancer])])
+AT_FULL_COMPILE([dancer])
 AT_PARSER_CHECK([./dancer], 1, [],
 [syntax error, unexpected ':'
 ])
@@ -1039,11 +1034,7 @@ m4_define([AT_CHECK_EXPECT2],
 AT_BISON_OPTION_PUSHDEFS([$1])
 _AT_DATA_EXPECT2_Y([$1])
 AT_BISON_CHECK([-o expect2.c expect2.y])
-AT_LALR1_CC_IF(
-  [AT_BISON_CHECK([-o expect2.cc expect2.y])
-   AT_COMPILE_CXX([expect2])],
-  [AT_BISON_CHECK([-o expect2.c expect2.y])
-   AT_COMPILE([expect2])])
+AT_FULL_COMPILE([expect2])
 AT_PARSER_CHECK([./expect2], 1, [],
 [syntax error, unexpected '+', expecting A or B
 ])
@@ -1201,7 +1192,7 @@ AT_CLEANUP
 ## Token number in precedence declaration.  ##
 ## ---------------------------------------- ##
 
-AT_SETUP([[Token number in precedence declaration.]])
+AT_SETUP([[Token number in precedence declaration]])
 
 # POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
 # we lost this in Bison 1.50.
@@ -1255,3 +1246,25 @@ AT_COMPILE([[input]])
 AT_PARSER_CHECK([[./input]])
 
 AT_CLEANUP
+
+
+
+## --------------------------- ##
+## parse-gram.y: LALR = IELR.  ##
+## --------------------------- ##
+
+# If parse-gram.y's LALR and IELR parser tables ever begin to differ, we
+# need to fix parse-gram.y or start using IELR.
+
+AT_SETUP([[parse-gram.y: LALR = IELR]])
+
+# Avoid differences in synclines by telling bison that the output files
+# have the same name.
+[cp $abs_top_srcdir/src/parse-gram.y input.y]
+AT_BISON_CHECK([[-o input.c -Dlr.type=lalr input.y]])
+[mv input.c lalr.c]
+AT_BISON_CHECK([[-o input.c -Dlr.type=ielr input.y]])
+[mv input.c ielr.c]
+AT_CHECK([[diff -u lalr.c ielr.c]])
+
+AT_CLEANUP