]> git.saurik.com Git - bison.git/commitdiff
Fix user actions without a trailing semicolon.
authorJoel E. Denny <jdenny@ces.clemson.edu>
Tue, 4 Nov 2008 20:03:00 +0000 (15:03 -0500)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Tue, 4 Nov 2008 20:58:57 +0000 (15:58 -0500)
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.

ChangeLog
THANKS
src/scan-code.l
tests/regression.at

index 0e93d7c5745d3d29f0e7a4798388737c66b32edd..ec5dd705491aeb9a2d9d4187d19089a91f9c20e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-11-04  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       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  <demaille@gostai.com>
 
        Use b4_copyright_years.
diff --git a/THANKS b/THANKS
index 9145916654e16dece29aa5f44228d0457d7ee336..761e276f403018588804dc7212d6fb9c9f8acefd 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -81,6 +81,7 @@ Robert Anisko             anisko_r@epita.fr
 Satya Kiran Popuri        satyakiran@gmail.com
 Sebastien Fricker         sebastien.fricker@gmail.com
 Sebastian Setzer          sebastian.setzer.ext@siemens.com
+Sergei Steshenko          sergstesh@yahoo.com
 Shura                     debil_urod@ngs.ru
 Steve Murphy              murf@parsetree.com
 Tim Josling               tej@melbpc.org.au
index 630d45d5315678b951b57b218809e4f0ebbb2984..71c90768efb4700f2d52d888b4e3a9d604a075bc 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -170,7 +170,7 @@ splice       (\\[ \f\t\v]*\n)*
 
   "{"  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
        brace in braced code, so that the user code can omit trailing
index 51bf3f308dab55311ed766405dba1df56ebf44b7..6bfc8d0986727f515475c1ef3d648b0b9d86c0db 100644 (file)
@@ -1201,7 +1201,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 +1255,27 @@ AT_COMPILE([[input]])
 AT_PARSER_CHECK([[./input]])
 
 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