From: Nuno Lopes Date: Tue, 8 Jul 2008 15:16:35 +0000 (+0000) Subject: now really fix once and for all the #-style comments. X-Git-Tag: php-5.3.0alpha1~440 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8673e35a0bbadba70292bd123a9e5c50305e2f7;p=php now really fix once and for all the #-style comments. also remove some duplicated code in value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; + goto inline_char_handler; } } @@ -1565,10 +1581,7 @@ NOWDOC_CHARS ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; + goto inline_char_handler; } } @@ -1581,10 +1594,7 @@ NOWDOC_CHARS ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; + goto inline_char_handler; } } @@ -1600,7 +1610,6 @@ NOWDOC_CHARS ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_ "value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1608,19 +1617,6 @@ NOWDOC_CHARS ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - -"#".+ {NEWLINE} { - if ((YYCTYPE*)yytext == SCNG(yy_start)) { - /* ignore first line when it's started with a # */ - goto restart; - } else { - YYCURSOR = yytext+1; goto inline_char_handler; } } @@ -1640,8 +1636,8 @@ inline_char_handler: } else { YYCURSOR = ptr + 1; - /* if it can be an opening tag, stop */ - if (YYCURSOR < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%')) { + /* stop if it may be an opening tag (). this condition is not optimal though */ + if (YYCURSOR < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%' || *YYCURSOR == 's')) { --YYCURSOR; yyleng = YYCURSOR - SCNG(yy_text); break;