From: Andi Gutmans Date: Thu, 24 Feb 2005 19:25:44 +0000 (+0000) Subject: - Make one line comments work the same with as with X-Git-Tag: RELEASE_0_3~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac63e8c2c1b896662bec7d550143c9e376347659;p=php - Make one line comments work the same with as with - other tags. This will break scripts that have whitespace at the end - of the closing tag but this is barely used as it is - and I doubt ppl used whitespace. (patch by Jani) --- diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 4482214082..f0b624a58d 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1433,11 +1433,11 @@ NEWLINE ("\r"|"\n"|"\r\n") yymore(); } -"?"|"%"|">" { +"?"|"%"|">"|"<" { yymore(); } -[^\n\r?%>]+ { +[^\n\r?%><]+ { yymore(); } @@ -1450,6 +1450,14 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_COMMENT; } +"" { + zendlval->value.str.val = yytext; /* no copying - intentional */ + zendlval->value.str.len = yyleng; + zendlval->type = IS_STRING; + BEGIN(ST_IN_SCRIPTING); + return T_COMMENT; +} + "?>"|"%>" { if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1498,7 +1506,7 @@ NEWLINE ("\r"|"\n"|"\r\n") yymore(); } -("?>"|""){NEWLINE}? { +("?>"|""){NEWLINE}? { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; zendlval->type = IS_STRING;