Fix user actions without a trailing semicolon.

Reported by Sergei Steshenko at
<http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
* THANKS (Sergei Steshenko): Add.
* src/scan-code.l (SC_RULE_ACTION): Fix it.
* tests/regression.at (Fix user actions without a trailing semicolon):
New test case.
This commit is contained in:
Joel E. Denny
2008-11-04 15:58:57 -05:00
parent 639867b52f
commit 58bd33b7fc
4 changed files with 38 additions and 3 deletions
+10
View File
@@ -1,3 +1,13 @@
2008-11-04 Joel E. Denny <[email protected]>
Fix user actions without a trailing semicolon.
Reported by Sergei Steshenko at
<http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
* THANKS (Sergei Steshenko): Add.
* src/scan-code.l (SC_RULE_ACTION): Fix it.
* tests/regression.at (Fix user actions without a trailing semicolon):
New test case.
2008-11-04 Akim Demaille <[email protected]> 2008-11-04 Akim Demaille <[email protected]>
Use b4_copyright_years. Use b4_copyright_years.
+1
View File
@@ -81,6 +81,7 @@ Robert Anisko [email protected]
Satya Kiran Popuri [email protected] Satya Kiran Popuri [email protected]
Sebastien Fricker [email protected] Sebastien Fricker [email protected]
Sebastian Setzer [email protected] Sebastian Setzer [email protected]
Sergei Steshenko [email protected]
Shura [email protected] Shura [email protected]
Steve Murphy [email protected] Steve Murphy [email protected]
Tim Josling [email protected] Tim Josling [email protected]
+2 -2
View File
@@ -1,6 +1,6 @@
/* Bison Action Scanner -*- C -*- /* Bison Action Scanner -*- C -*-
Copyright (C) 2006, 2007 Free Software Foundation, Inc. Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -170,7 +170,7 @@ splice (\\[ \f\t\v]*\n)*
"{" STRING_GROW; ++braces_level; "{" STRING_GROW; ++braces_level;
"}" { "}" {
bool outer_brace = --braces_level < 0; bool outer_brace = --braces_level == 0;
/* As an undocumented Bison extension, append `;' before the last /* As an undocumented Bison extension, append `;' before the last
brace in braced code, so that the user code can omit trailing brace in braced code, so that the user code can omit trailing
+25 -1
View File
@@ -1201,7 +1201,7 @@ AT_CLEANUP
## Token number in precedence declaration. ## ## 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 # POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
# we lost this in Bison 1.50. # we lost this in Bison 1.50.
@@ -1255,3 +1255,27 @@ AT_COMPILE([[input]])
AT_PARSER_CHECK([[./input]]) AT_PARSER_CHECK([[./input]])
AT_CLEANUP AT_CLEANUP
## ----------------------------------------------- ##
## Fix user actions without a trailing semicolon. ##
## ----------------------------------------------- ##
AT_SETUP([[Fix user actions without a trailing semicolon]])
# 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_DATA([input.y],
[[%%
start: {asdffdsa} ;
]])
AT_BISON_CHECK([[-o input.c input.y]])
AT_CHECK([[sed -n '/asdffdsa/s/^ *//p' input.c]], [[0]],
[[{asdffdsa;}
]])
AT_CLEANUP