Hi,

Probably not much chance of this happening, but while looking through HEAD's
lexer/parser code (which word is correct? :-)), I noticed that there's no
rule to match a backslash followed by a \n newline inside single quotes,
resulting in "Unexpected character in input ..."  The ST_SINGLE_QUOTE state
used to match this (as in 5.2), but was removed in version 1.132 of
zend_language_scanner.l.

Untested, but I think the attached patch should take care of it.


Matt
Index: zend_language_scanner.l
===================================================================
RCS file: /repository/ZendEngine2/zend_language_scanner.l,v
retrieving revision 1.158
diff -u -r1.158 zend_language_scanner.l
--- zend_language_scanner.l     18 Sep 2006 17:59:10 -0000      1.158
+++ zend_language_scanner.l     19 Oct 2006 03:38:34 -0000
@@ -2223,7 +2223,7 @@
 }
 
 
-<ST_IN_SCRIPTING>([']([^'\\]|("\\".))*[']) {
+<ST_IN_SCRIPTING>([']([^'\\]|("\\"{ANY_CHAR}))*[']) {
        if (UG(unicode)) {
                return zend_scan_unicode_single_string(zendlval TSRMLS_CC);
        } else {
@@ -2232,7 +2232,7 @@
 }
 
 
-<ST_IN_SCRIPTING>("b'"([^'\\]|("\\".))*[']) {
+<ST_IN_SCRIPTING>("b'"([^'\\]|("\\"{ANY_CHAR}))*[']) {
        yytext++; /* adjust for 'b' */
        yyleng--;
        return zend_scan_binary_single_string(zendlval TSRMLS_CC);

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to