From: Ilia Alshanetsky Date: Thu, 8 Dec 2005 03:09:14 +0000 (+0000) Subject: Improve fix for bug #35382 X-Git-Tag: php-5.1.2RC1~168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d4c1d68869f98e5703973316ce86c7163b6b6f9;p=php Improve fix for bug #35382 --- diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 332e5c0bf8..af4059fef7 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1461,16 +1461,22 @@ NEWLINE ("\r"|"\n"|"\r\n") yymore(); } -[^\n\r?%>]+ { - yymore(); -} - -<> { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return EOF; +[^\n\r?%>]+{ANY_CHAR} { + switch (yytext[yyleng-1]) { + case '?': case '%': case '>': + yyless(yyleng-1); + yymore(); + break; + case '\n': + CG(zend_lineno)++; + /* intentional fall through */ + default: + zendlval->value.str.val = yytext; /* no copying - intentional */ + zendlval->value.str.len = yyleng; + zendlval->type = IS_STRING; + BEGIN(ST_IN_SCRIPTING); + return T_COMMENT; + } } {NEWLINE} {