RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1) / zend_compile.c zend_highlight.c zend_language_scanner.l /tests bug31341.phpt bug35411.phpt
| From: | Dmitry Stogov | Date: | Wed, 07 Dec 2005 12:45:01 +0000 |
| Subject: | RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1) / zend_compile.c zend_highlight.c zend_language_scanner.l /tests bug31341.phpt bug35411.phpt | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-4431@lists.php.net to get a copy of this message | ||
Hi,
The "comment in end of file" isn't fixed correct in both 5.1 and HEAD.
$ php -r tests/lang/bug35382.php
5.1 doesn't print "//" and prints "\0\0" instead.
HEAD fails with scanner internal error.
Thanks. Dmitry.
Ilia, please commit your fixes in HEAD too (not just into 5.1).
I afraid a lot of your fixes are lost for HEAD.
> -----Original Message-----
> From: Ilia Alshanetsky [mailto:iliaa@php.net]
> Sent: Sunday, November 27, 2005 9:40 AM
> To: zend-engine-cvs@lists.php.net
> Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1) /
> zend_compile.c zend_highlight.c zend_language_scanner.l
> /tests bug31341.phpt bug35411.phpt
>
>
> iliaa Sun Nov 27 01:39:32 2005 EDT
>
> Added files: (Branch: PHP_5_1)
> /ZendEngine2/tests bug35411.phpt
>
> Modified files:
> /ZendEngine2 zend_compile.c zend_highlight.c
> zend_language_scanner.l
> /ZendEngine2/tests bug31341.phpt
> Log:
> Fixed bug #35411 (Regression with \{$ handling).
> Fixed bug #35382 (Comment in end of file produces fatal error).
>
>
> http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.64
> 7.2.17&r2=1.647.2.18&ty=u
> Index: ZendEngine2/zend_compile.c
> diff -u ZendEngine2/zend_compile.c:1.647.2.17
> ZendEngine2/zend_compile.c:1.647.2.18
> --- ZendEngine2/zend_compile.c:1.647.2.17 Thu Nov 24 06:33:11 2005
> +++ ZendEngine2/zend_compile.c Sun Nov 27 01:39:27 2005
> @@ -17,7 +17,7 @@
>
> +-------------------------------------------------------------
> ---------+
> */
>
> -/* $Id: zend_compile.c,v 1.647.2.17 2005/11/24 11:33:11
> dmitry Exp $ */
> +/* $Id: zend_compile.c,v 1.647.2.18 2005/11/27 06:39:27
> iliaa Exp $ */
>
> #include <zend_language_parser.h>
> #include "zend.h"
> @@ -3998,6 +3998,8 @@
> case T_END_HEREDOC:
> efree(zendlval->u.constant.value.str.val);
> break;
> + case EOF:
> + return EOF;
> }
>
> INIT_PZVAL(&zendlval->u.constant);
> http://cvs.php.net/diff.php/ZendEngine2/zend_highlight.c?r1=1.
> 49&r2=1.49.2.1&ty=u
> Index: ZendEngine2/zend_highlight.c
> diff -u ZendEngine2/zend_highlight.c:1.49
> ZendEngine2/zend_highlight.c:1.49.2.1
> --- ZendEngine2/zend_highlight.c:1.49 Wed Aug 3 09:30:53 2005
> +++ ZendEngine2/zend_highlight.c Sun Nov 27 01:39:28 2005
> @@ -17,7 +17,7 @@
>
> +-------------------------------------------------------------
> ---------+
> */
>
> -/* $Id: zend_highlight.c,v 1.49 2005/08/03 13:30:53 sniper Exp $ */
> +/* $Id: zend_highlight.c,v 1.49.2.1 2005/11/27 06:39:28
> iliaa Exp $ */
>
> #include "zend.h"
> #include <zend_language_parser.h>
> @@ -164,6 +164,8 @@
>
> if (token.type == IS_STRING) {
> switch (token_type) {
> + case EOF:
> + goto done;
> case T_OPEN_TAG:
> case T_OPEN_TAG_WITH_ECHO:
> case T_CLOSE_TAG:
> @@ -180,6 +182,7 @@
> }
> token.type = 0;
> }
> +done:
> if (last_color != syntax_highlighter_ini->highlight_html) {
> zend_printf("</span>\n");
> }
> @@ -208,6 +211,9 @@
> case T_DOC_COMMENT:
> token.type = 0;
> continue;
> +
> + case EOF:
> + return;
>
> case T_END_HEREDOC: {
> char *ptr =
> LANG_SCNG(yy_text);
> http://cvs.php.net/diff.php/ZendEngine2/zend_language_scanner.
> l?r1=1.131.2.5&r2=1.131.2.6&ty=u
> Index: ZendEngine2/zend_language_scanner.l
> diff -u ZendEngine2/zend_language_scanner.l:1.131.2.5
> ZendEngine2/zend_language_scanner.l:1.131.2.6
> --- ZendEngine2/zend_language_scanner.l:1.131.2.5 Sat Nov
> 26 08:11:26 2005
> +++ ZendEngine2/zend_language_scanner.l Sun Nov 27 01:39:28 2005
> @@ -19,7 +19,7 @@
>
> +-------------------------------------------------------------
> ---------+
> */
>
> -/* $Id: zend_language_scanner.l,v 1.131.2.5 2005/11/26
> 13:11:26 helly Exp $ */
> +/* $Id: zend_language_scanner.l,v 1.131.2.6 2005/11/27
> 06:39:28 iliaa
> +Exp $ */
>
> #define yyleng SCNG(yy_leng)
> #define yytext SCNG(yy_text)
> @@ -1469,8 +1469,8 @@
> zendlval->value.str.val = yytext; /* no copying - intentional */
> zendlval->value.str.len = yyleng;
> zendlval->type = IS_STRING;
> - BEGIN(ST_IN_SCRIPTING);
> - return T_COMMENT;
> + BEGIN(INITIAL);
> + return EOF;
> }
>
> <ST_ONE_LINE_COMMENT>{NEWLINE} {
> @@ -1806,6 +1806,13 @@
> return yytext[0];
> }
>
> +<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\{" {
> + zendlval->value.str.val = estrndup("\\{", sizeof("\\{") - 1);
> + zendlval->value.str.len = sizeof("\\{") - 1;
> + zendlval->type = IS_STRING;
> + return T_STRING;
> +}
> +
> <ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
> zendlval->value.lval = (long) yytext[0];
> yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
> @@ -1844,13 +1851,6 @@
> return T_CHARACTER;
> }
>
> -<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\{$" {
> - zendlval->value.str.val = estrndup("{$", sizeof("{$")-1);
> - zendlval->value.str.len = sizeof("{$")-1;
> - zendlval->type = IS_STRING;
> - return T_STRING;
> -}
> -
> <ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"{ANY_CHAR} {
> switch (yytext[1]) {
> case 'n':
> http://cvs.php.net/diff.php/ZendEngine2/tests/bug31341.phpt?r1
=1.1.2.1&r2=1.1.2.2&ty=u
Index: ZendEngine2/tests/bug31341.phpt
diff -u ZendEngine2/tests/bug31341.phpt:1.1.2.1
ZendEngine2/tests/bug31341.phpt:1.1.2.2
--- ZendEngine2/tests/bug31341.phpt:1.1.2.1 Fri Oct 21 09:22:05 2005
+++ ZendEngine2/tests/bug31341.phpt Sun Nov 27 01:39:31 2005
@@ -20,7 +20,7 @@
--EXPECT--
'$ \{ '
' \{ $'
-' {$ '
+' \{$ '
' $\{ '
' $\{ '
' \{$ '
http://cvs.php.net/co.php/ZendEngine2/tests/bug35411.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug35411.phpt
+++ ZendEngine2/tests/bug35411.phpt
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php