#45372 [Opn->Ctl]: hash# check in new re2c parser breaks code
ID: 45372
Updated by: alan_k@php.net
Reported By: alan_k@php.net
-Status: Open
+Status: Critical
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.3CVS-2008-06-27 (CVS)
New Comment:
marking as critical....
Previous Comments:
------------------------------------------------------------------------
[2008-06-27 06:00:54] alan_k@php.net
Description:
------------
single line file:
<?php if (1) { ?>#<?php } ?>
produces a parse error:
get's caught with this rule from the re2c scanner.
<INITIAL>"#".+ {NEWLINE} {
if ((YYCTYPE*)yytext == SCNG(yy_start)) {
/* ignore first line when it's started with a # */
goto restart;
} else {
goto inline_char_handler;
}
}
basically the scanner runs off the end, and eats everything after the
#
I've fixed it by changing the above to something like:
} else {
/* shunt back to just return the # on it's own.. */
YYCURSOR = YYMARKER;
yyleng = 1;
goto inline_char_handler;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45372&edit=1
Thread (10 messages)