[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: {...} without actions
From: |
Akim Demaille |
Subject: |
Re: FYI: {...} without actions |
Date: |
Mon, 03 Apr 2006 15:54:32 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
The following message is a courtesy copy of an article
that has been posted to epita.cours.compile as well.
I forgot the CC, sorry for the duplicate.
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/scan-gram.l: Be robust to BRACED_CODE appearing before any
rule.
Reported by Mickael Labau.
* tests/input.at (Torturing the Scanner): Test it.
Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.62
diff -u -r1.62 THANKS
--- THANKS 13 Oct 2005 10:13:23 -0000 1.62
+++ THANKS 3 Apr 2006 13:49:50 -0000
@@ -45,6 +45,7 @@
Matt Kraai address@hidden
Matt Rosing address@hidden
Michael Hayes address@hidden
+Mickael Labau address@hidden
Mike Castle address@hidden
Neil Booth address@hidden
Nelson H. F. Beebe address@hidden
Index: src/scan-gram.l
===================================================================
RCS file: /cvsroot/bison/bison/src/scan-gram.l,v
retrieving revision 1.85
diff -u -r1.85 scan-gram.l
--- src/scan-gram.l 30 Jan 2006 07:25:59 -0000 1.85
+++ src/scan-gram.l 3 Apr 2006 13:49:50 -0000
@@ -292,7 +292,7 @@
/* Code in between braces. */
"{" {
- if (current_rule->action)
+ if (current_rule && current_rule->action)
grammar_midrule_action ();
STRING_GROW;
token_type = BRACED_CODE;
Index: tests/input.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/input.at,v
retrieving revision 1.42
diff -u -r1.42 input.at
--- tests/input.at 30 Jan 2006 09:00:40 -0000 1.42
+++ tests/input.at 3 Apr 2006 13:49:51 -0000
@@ -204,6 +204,14 @@
]])
+AT_DATA([input.y],
+[{}
+])
+AT_CHECK([bison input.y], [1], [],
+[[input.y:1.1-2: syntax error, unexpected {...}
+]])
+
+
AT_DATA_GRAMMAR([input.y],
[[%{
/* This is seen in GCC: a %{ and %} in middle of a comment. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: FYI: {...} without actions,
Akim Demaille <=