Index: zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.131.2.11.2.11 diff -u -r1.131.2.11.2.11 zend_language_scanner.l --- zend_language_scanner.l 18 May 2007 13:12:04 -0000 1.131.2.11.2.11 +++ zend_language_scanner.l 22 May 2007 12:34:00 -0000 @@ -1653,9 +1653,19 @@ return yytext[0]; } -[ \n\r\t'"`\\#] { - yyless(0); +[ \t'"`\\#]|("\\"[^\n\r])|{NEWLINE} { yy_pop_state(TSRMLS_C); + + if ((YYSTATE == ST_DOUBLE_QUOTES && yytext[0] == '"') || (YYSTATE == ST_BACKQUOTE && yytext[0] == '`')) { + BEGIN(ST_IN_SCRIPTING); + return yytext[0]; + } else if (YYSTATE == ST_HEREDOC && (yytext[0] == '\n' || yytext[0] == '\r')) { + BEGIN(ST_START_HEREDOC); /* So the next line is checked for a label */ + } + + HANDLE_NEWLINE(yytext[0]); + ZVAL_EMPTY_STRING(zendlval); /* Empty since it won't be used */ + return T_ENCAPSED_AND_WHITESPACE; } {LABEL} { @@ -1935,8 +1945,8 @@ zend_scan_escape_string(zendlval, yytext, len, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } else { - /* Go back to end of label, so there's something to match again in case - * there's a variable at the beginning of the next line */ + /* Go back to end of label, so the next match works correctly in case of + * a variable or another label at the beginning of the next line */ yyless(yyleng - 1); yymore(); } @@ -1954,10 +1964,10 @@ } -"{$" { +%{/* Will only match when $ follows: "{$" */%} +"{" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); return T_CURLY_OPEN; }