]> git.saurik.com Git - bison.git/blobdiff - tests/regression.at
Pass the token type to yysyntax_error.
[bison.git] / tests / regression.at
index 6bfc8d0986727f515475c1ef3d648b0b9d86c0db..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
 ])
@@ -1258,24 +1249,22 @@ AT_CLEANUP
 
 
 
-## ----------------------------------------------- ##
-## Fix user actions without a trailing semicolon.  ##
-## ----------------------------------------------- ##
+## --------------------------- ##
+## parse-gram.y: LALR = IELR.  ##
+## --------------------------- ##
 
-AT_SETUP([[Fix user actions without a trailing semicolon]])
+# 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.
 
-# This feature is undocumented, but we accidentally broke it in 2.3a, and there
-# was a complaint at:
-# <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
+AT_SETUP([[parse-gram.y: LALR = IELR]])
 
-AT_DATA([input.y],
-[[%%
-start: {asdffdsa} ;
-]])
-
-AT_BISON_CHECK([[-o input.c input.y]])
-AT_CHECK([[sed -n '/asdffdsa/s/^ *//p' input.c]], [[0]],
-[[{asdffdsa;}
-]])
+# 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