#45372 [Opn->Asn]: hash# check in new re2c parser breaks code
ID: 45372
Updated by: jani@php.net
Reported By: alan_k@php.net
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.3CVS-2008-06-27 (CVS)
-Assigned To: helly
+Assigned To: nlopess
New Comment:
Nuno, fix not correct?
Previous Comments:
------------------------------------------------------------------------
[2008-07-07 14:12:44] mattwil@php.net
This is not fixed, actually (is it OK to change Status back to Open?).
Nuno, I saw your commit yesterday, which didn't seem like it would help
(as it wasn't related to what I said above), but wanted to wait until I
could check again to make sure I wasn't crazy with my above description.
:-)
I just tried the latest Windows snapshot and it's still generating a
parse error with the *single line file* (no newline at the end, which .+
won't match, therefore won't trigger the YYFILL() "return 0" thing)
descibed in this report (and the CLI example in Bug #44654). Can't be
only broken on Windows since everything uses the same generated scanner
code...
Something like Alan's scanning loop could be done after just matching
#, BUT that's just another workaround for that underlying re2c/YYFILL()
problem (also affecting other things). I believe if you use the
tokenizer extension, you can see that if the last token of code is
matched by a variable length rule, it won't be returned. e.g. my example
of a simple rule, [a-z]+ not matching input "foo"
------------------------------------------------------------------------
[2008-07-06 17:01:55] nlopess@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2008-06-27 14:57:57] alan_k@php.net
Not sure why re2c needs to deal with the #bang situation
looking at the code it would be better to eat that line outside of the
lexer..
Something like:
int ini_lex(zval *ini_lval TSRMLS_DC)
{
if ((YYCTYPE*)yytext == SCNG(yy_start) && *yych == '#') {
while(*yych != '\n' && *yych != '\n' && yych <
yyend) {
yych++;
}
while((*yych == '\n' || *yych == '\n') && yych < yyend) {
yych++;
}
YYCURSOR = yych;
}
.....
------------------------------------------------------------------------
[2008-06-27 11:26:18] felipe@php.net
Duplicated... Bug #45147
------------------------------------------------------------------------
[2008-06-27 09:31:21] johannes@php.net
This should work like in older releases, Marcus please check it!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45372
--
Edit this bug report at http://bugs.php.net/?id=45372&edit=1
Thread (10 messages)