develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33563 - trunk/compilers/pirc/new

From:
kjs
Date:
December 6, 2008 07:34
Subject:
[svn:parrot] r33563 - trunk/compilers/pirc/new
Message ID:
20081206153408.3E02FCB9AF@x12.develooper.com
Author: kjs
Date: Sat Dec  6 07:34:07 2008
New Revision: 33563

Modified:
   trunk/compilers/pirc/new/hdocprep.c
   trunk/compilers/pirc/new/hdocprep.l

Log:
[pirc] fix heredoc preprocessor to handle comments at end of file properly. If you write a line comment on the last line, without a \n at the end, the # would be written to the intermediate file; the PIR lexer doesn't know how to handle #s, so error. Fix this. (easy fix: the {EOL} in a line comment becomes optional, so that the rule is also matched if there's no \n)

Modified: trunk/compilers/pirc/new/hdocprep.c
==============================================================================
--- trunk/compilers/pirc/new/hdocprep.c	(original)
+++ trunk/compilers/pirc/new/hdocprep.c	Sat Dec  6 07:34:07 2008
@@ -484,15 +484,15 @@
 static yyconst flex_int16_t yy_accept[118] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   21,   19,    5,   19,   19,   19,
-       19,   19,   20,    4,   20,   20,   20,   18,   15,   17,
-       15,   18,   18,   18,   20,    7,   20,   20,   20,    8,
-       20,   20,   20,    9,   20,   20,   13,   12,   13,   13,
-       13,    5,    0,    1,    0,    0,    0,    0,    2,    0,
-        0,    4,    0,    0,    1,    0,    0,   17,    0,   16,
-        0,    0,    0,    7,    0,    0,    1,    0,    0,    8,
-        0,    0,    1,    0,    0,   10,    0,    9,    0,    1,
-        0,   12,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,   21,   19,    5,   19,    1,   19,
+       19,   19,   20,    4,   20,    1,   20,   18,   15,   17,
+       15,   18,    1,   18,   20,    7,   20,    1,   20,    8,
+       20,    1,   20,    9,   20,    1,   13,   12,   13,    1,
+       13,    5,    1,    1,    1,    0,    0,    0,    2,    0,
+        0,    4,    0,    1,    1,    1,    0,   17,    0,   16,
+        0,    0,    0,    7,    0,    1,    1,    1,    0,    8,
+        0,    1,    1,    1,    0,   10,    0,    9,    1,    1,
+        1,   12,    0,    0,    0,    0,    0,    0,    0,    0,
 
         0,    6,    0,    0,    0,    0,   11,    0,    0,    0,
         0,    3,    0,    0,    0,   14,    0

Modified: trunk/compilers/pirc/new/hdocprep.l
==============================================================================
--- trunk/compilers/pirc/new/hdocprep.l	(original)
+++ trunk/compilers/pirc/new/hdocprep.l	Sat Dec  6 07:34:07 2008
@@ -275,7 +275,7 @@
 DQ_STRING       \"(\\.|[^"\\\n])*\"
 SQ_STRING       \'[^'\n]*\'
 Q_STRING       {SQ_STRING}|{DQ_STRING}
-LINECOMMENT    [#].*{EOL}
+LINECOMMENT    [#].*{EOL}?
 
 %%
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About