logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

RE: cvs: ZendEngine2 / zend_language_scanner.l: msg#00028

Subject: RE: cvs: ZendEngine2 / zend_language_scanner.l
Hi Ilia,

Seems this patch doesn't care about all cases too.

"//<<EOF>>"

"// sdfsfd?<<EOF>>"

Also I am not sure about proper "\r" and "\r\n" handling.

Thanks. Dmitry.

> -----Original Message-----
> From: Ilia Alshanetsky [mailto:iliaa@xxxxxxx] 
> Sent: Thursday, December 08, 2005 6:13 AM
> To: zend-engine-cvs@xxxxxxxxxxxxx
> Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_language_scanner.l 
> 
> 
> iliaa         Wed Dec  7 22:12:35 2005 EDT
> 
>   Modified files:              
>     /ZendEngine2      zend_language_scanner.l 
>   Log:
>   MFB51: 
>       fix for bug #35382
>       fix for bug #35411
>   
>   
>   
> http://cvs.php.net/diff.php/ZendEngine2/zend_language_scanner.
> l?r1=1.139&r2=1.140&ty=u
> Index: ZendEngine2/zend_language_scanner.l
> diff -u ZendEngine2/zend_language_scanner.l:1.139 
> ZendEngine2/zend_language_scanner.l:1.140
> --- ZendEngine2/zend_language_scanner.l:1.139 Sat Nov 26 08:09:28 2005
> +++ ZendEngine2/zend_language_scanner.l       Wed Dec  7 22:12:34 2005
> @@ -19,7 +19,7 @@
>     
> +-------------------------------------------------------------
> ---------+
>  */
>  
> -/* $Id: zend_language_scanner.l,v 1.139 2005/11/26 13:09:28 
> helly Exp $ */
> +/* $Id: zend_language_scanner.l,v 1.140 2005/12/08 03:12:34 
> iliaa Exp $ 
> +*/
>  
>  #define yyleng SCNG(yy_leng)
>  #define yytext SCNG(yy_text)
> @@ -2106,16 +2106,22 @@
>       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(ST_IN_SCRIPTING);
> -     return T_COMMENT;
> +<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} {
> @@ -2435,9 +2441,8 @@
>       }
>  }
>  
> -
> -<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\{$" {
> -     if (!zend_copy_string_value(zendlval, yytext+1, 
> yyleng-1, CG(literal_type) TSRMLS_CC)) {
> +<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\{" {
> +     if (!zend_copy_string_value(zendlval, yytext, yyleng, 
> CG(literal_type) 
> +TSRMLS_CC)) {
>               return 0;
>       }
>       return T_STRING;
> 
> -- 
> Zend Engine CVS Mailing List (http://cvs.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>