Index: zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.165 diff -u -r1.165 zend_language_scanner.l --- zend_language_scanner.l 18 May 2007 13:12:47 -0000 1.165 +++ zend_language_scanner.l 22 May 2007 12:34:00 -0000 @@ -2191,9 +2191,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_TEXT(zendlval); /* Empty since it won't be used */ + return T_ENCAPSED_AND_WHITESPACE; } {LABEL} { @@ -2483,8 +2493,8 @@ 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(); } @@ -2502,10 +2512,10 @@ } -"{$" { +%{/* Will only match when $ follows: "{$" */%} +"{" { Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); return T_CURLY_OPEN; }