[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bison-1.50: how to parse apostrophe?
From: |
Akim Demaille |
Subject: |
Re: bison-1.50: how to parse apostrophe? |
Date: |
11 Oct 2002 13:22:38 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
>>>>> "Jan" == Jan Nieuwenhuizen <address@hidden> writes:
Jan> In our grammar file, we have this expression:
Jan> sup_quotes: '\'' { $$ = 1; } | sup_quotes '\'' { $$ ++; } ;
Jan> but bison-1.50 doesn't like it:
Could you confirm that the following patch works? Thanks!
Index: ChangeLog
from Akim Demaille <address@hidden>
* tests/regression.at Characters Escapes): New.
* src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
characters.
Reported by Jan Nieuwenhuizen.
Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.47
diff -u -u -r1.47 THANKS
--- THANKS 30 Sep 2002 12:27:31 -0000 1.47
+++ THANKS 11 Oct 2002 11:21:46 -0000
@@ -21,6 +21,7 @@
Florian Krohm address@hidden
H. Merijn Brand address@hidden
Hans Aberg address@hidden
+Jan Nieuwenhuizen address@hidden
Jesse Thilo address@hidden
Jim Meyering address@hidden
Juan Manuel Guerrero address@hidden
Index: src/scan-gram.l
===================================================================
RCS file: /cvsroot/bison/bison/src/scan-gram.l,v
retrieving revision 1.24
diff -u -u -r1.24 scan-gram.l
--- src/scan-gram.l 12 Aug 2002 14:52:47 -0000 1.24
+++ src/scan-gram.l 11 Oct 2002 11:21:48 -0000
@@ -347,7 +347,7 @@
\\r obstack_1grow (&string_obstack, '\r');
\\t obstack_1grow (&string_obstack, '\t');
\\v obstack_1grow (&string_obstack, '\v');
- \\[\\""] obstack_1grow (&string_obstack, yytext[1]);
+ \\[\\""''] obstack_1grow (&string_obstack, yytext[1]);
\\(.|\n) {
LOCATION_PRINT (stderr, *yylloc);
fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
Index: tests/regression.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/regression.at,v
retrieving revision 1.68
diff -u -u -r1.68 regression.at
--- tests/regression.at 5 Oct 2002 04:50:45 -0000 1.68
+++ tests/regression.at 11 Oct 2002 11:21:48 -0000
@@ -333,6 +333,32 @@
+## -------------------- ##
+## Characters Escapes. ##
+## -------------------- ##
+
+
+AT_SETUP([Characters Escapes])
+
+AT_DATA([input.y],
+[%{
+void yyerror (const char *s);
+int yylex (void);
+%}
+[%%
+exp:
+ '\'' "\'"
+| '\"' "\""
+| '"' "'"
+;
+]])
+
+AT_CHECK([bison input.y -o input.c])
+AT_COMPILE([input.o], [-c input.c])
+AT_CLEANUP
+
+
+
## -------------- ##
## Web2c Report. ##
## -------------- ##
Re: bison-1.50: how to parse apostrophe?,
Akim Demaille <=