Error in lexer generator

7 views
Skip to first unread message

Thue Janus Kristensen

unread,
Dec 26, 2009, 2:13:55 PM12/26/09
to smarty-d...@googlegroups.com
There is an error in the lexer generator which causes positive lookahead [ (?=...) ] to not work in the lexers generated by the lexer generator.

The following patch fixes it. I have already reported the bug to http://pear.php.net/package/PHP_LexerGenerator .

This will probably enable some token regexps in the template lexer to be simpler, and my rewrite of the config lexer/parser (soon to be sent) depends on it.

Regards, Thue

Index: lexer/LexerGenerator/Regex/Parser.php
===================================================================
--- lexer/LexerGenerator/Regex/Parser.php       (revision 3406)
+++ lexer/LexerGenerator/Regex/Parser.php       (working copy)
@@ -1594,7 +1594,7 @@
 #line 428 "Parser.y"
     function yy_r82(){
     $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?=' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array(
-        'pattern '=> '(?=' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')'));
+        'pattern' => '(?=' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')'));
     }
 #line 1605 "Parser.php"
 #line 432 "Parser.y"

Reply all
Reply to author
Forward
0 new messages