diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-12-08 03:09:14 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-12-08 03:09:14 +0000 |
commit | 3d4c1d68869f98e5703973316ce86c7163b6b6f9 (patch) | |
tree | 2f01b858a721b5e2ed520868ba2be7ec841e909e | |
parent | 644cf0550536bca3bc8a2b55e98a24c95fcaf052 (diff) | |
download | php-git-3d4c1d68869f98e5703973316ce86c7163b6b6f9.tar.gz |
Improve fix for bug #35382
-rw-r--r-- | Zend/zend_language_scanner.l | 26 |
1 files changed, 16 insertions, 10 deletions
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(); } -<ST_ONE_LINE_COMMENT>[^\n\r?%>]+ { - yymore(); -} - -<ST_ONE_LINE_COMMENT><<EOF>> { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return EOF; +<ST_ONE_LINE_COMMENT>[^\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; + } } <ST_ONE_LINE_COMMENT>{NEWLINE} { |