[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
moriyoshi Fri Jul 25 03:41:38 2008 UTC Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Suppress signedness warnings. http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.49&r2=1.50&diff_format=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.49 php-src/ext/tokenizer/tokenizer.c:1.50 --- php-src/ext/tokenizer/tokenizer.c:1.49 Mon Jun 23 17:25:01 2008 +++ php-src/ext/tokenizer/tokenizer.c Fri Jul 25 03:41:38 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.49 2008/06/23 17:25:01 felipe Exp $ */ +/* $Id: tokenizer.c,v 1.50 2008/07/25 03:41:38 moriyoshi Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -142,12 +142,12 @@ add_next_index_stringl(keyword, Z_STRVAL(token), Z_STRLEN(token), 1); efree(Z_STRVAL(token)); } else { - add_next_index_stringl(keyword, zendtext, zendleng, 1); + add_next_index_stringl(keyword, (char *)zendtext, zendleng, 1); } add_next_index_long(keyword, token_line); add_next_index_zval(return_value, keyword); } else { - add_next_index_stringl(return_value, zendtext, zendleng, 1); + add_next_index_stringl(return_value, (char *)zendtext, zendleng, 1); } if (destroy && Z_TYPE(token) != IS_NULL) { zval_dtor(&token); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
felipe Mon Jun 23 17:25:01 2008 UTC Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Added arginfo http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.48&r2=1.49&diff_format=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.48 php-src/ext/tokenizer/tokenizer.c:1.49 --- php-src/ext/tokenizer/tokenizer.c:1.48 Wed Jun 11 07:45:26 2008 +++ php-src/ext/tokenizer/tokenizer.c Mon Jun 23 17:25:01 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.48 2008/06/11 07:45:26 dmitry Exp $ */ +/* $Id: tokenizer.c,v 1.49 2008/06/23 17:25:01 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -35,13 +35,25 @@ #define zendtext LANG_SCNG(yy_text) #define zendleng LANG_SCNG(yy_leng) +/* {{{ arginfo */ +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_token_get_all, 0, 0, 1) + ZEND_ARG_INFO(0, source) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_token_name, 0, 0, 1) + ZEND_ARG_INFO(0, token) +ZEND_END_ARG_INFO() +/* }}} */ + /* {{{ tokenizer_functions[] * * Every user visible function must have an entry in tokenizer_functions[]. */ const zend_function_entry tokenizer_functions[] = { - PHP_FE(token_get_all, NULL) - PHP_FE(token_name, NULL) + PHP_FE(token_get_all, arginfo_token_get_all) + PHP_FE(token_name, arginfo_token_name) {NULL, NULL, NULL} /* Must be the last line in tokenizer_functions[] */ }; /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
dmitry Wed Jun 11 07:45:26 2008 UTC Modified files: /php-src/ext/tokenizer tokenizer.c Log: Fixed memory leak http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.47&r2=1.48&diff_format=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.47 php-src/ext/tokenizer/tokenizer.c:1.48 --- php-src/ext/tokenizer/tokenizer.c:1.47 Wed Mar 26 14:46:17 2008 +++ php-src/ext/tokenizer/tokenizer.c Wed Jun 11 07:45:26 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.47 2008/03/26 14:46:17 scottmac Exp $ */ +/* $Id: tokenizer.c,v 1.48 2008/06/11 07:45:26 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -170,6 +170,10 @@ tokenize(return_value TSRMLS_CC); + while (!zend_stack_is_empty(&LANG_SCNG(state_stack))) { + zend_stack_del_top(&LANG_SCNG(state_stack)); + } + zend_restore_lexical_state(&original_lex_state TSRMLS_CC); zval_dtor(&source_z); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
dmitry Tue Feb 12 09:28:31 2008 UTC Modified files: /php-src/ext/tokenizer tokenizer.c Log: Added NOWDOC http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.45&r2=1.46&diff_format=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.45 php-src/ext/tokenizer/tokenizer.c:1.46 --- php-src/ext/tokenizer/tokenizer.c:1.45 Mon Dec 31 07:12:17 2007 +++ php-src/ext/tokenizer/tokenizer.c Tue Feb 12 09:28:30 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.45 2007/12/31 07:12:17 sebastian Exp $ */ +/* $Id: tokenizer.c,v 1.46 2008/02/12 09:28:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -180,7 +180,7 @@ MAKE_STD_ZVAL(keyword); array_init(keyword); add_next_index_long(keyword, token_type); - if (token_type == T_END_HEREDOC) { + if (token_type == T_END_HEREDOC || token_type == T_END_NOWDOC) { if (CG(increment_lineno)) { token_line = ++CG(zend_lineno); CG(increment_lineno) = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c /ext/tokenizer/tests 001.phpt bug26463.phpt ZendEngine2 zend_compile.c zend_compile.h zend_language_parser.y zend_language_scanner.l zend_vm_def.h z
dmitry Fri May 18 13:12:47 2007 UTC Modified files: /ZendEngine2zend_compile.c zend_compile.h zend_language_parser.y zend_language_scanner.l zend_vm_def.h zend_vm_execute.h /php-src/ext/tokenizer tokenizer.c /php-src/ext/tokenizer/tests001.phpt bug26463.phpt Log: Improved compilation of heredocs and interpolated strings. (Matt) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.748&r2=1.749&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.748 ZendEngine2/zend_compile.c:1.749 --- ZendEngine2/zend_compile.c:1.748Fri May 11 09:38:52 2007 +++ ZendEngine2/zend_compile.c Fri May 18 13:12:47 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_compile.c,v 1.748 2007/05/11 09:38:52 tony2001 Exp $ */ +/* $Id: zend_compile.c,v 1.749 2007/05/18 13:12:47 dmitry Exp $ */ #include #include "zend.h" @@ -989,25 +989,25 @@ } -void zend_do_add_char(znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ADD_CHAR; - opline->op1 = *op1; - opline->op2 = *op2; - opline->op2.op_type = IS_CONST; - opline->extended_value = CG(literal_type); - opline->result = opline->op1; - *result = opline->result; -} - - void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); + zend_op *opline; - opline->opcode = ZEND_ADD_STRING; + if (Z_UNILEN(op2->u.constant) > 1) { + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + opline->opcode = ZEND_ADD_STRING; + } else if (Z_UNILEN(op2->u.constant) == 1) { + int ch = (Z_TYPE(op2->u.constant) == IS_UNICODE) ? *Z_USTRVAL(op2->u.constant) : *Z_STRVAL(op2->u.constant); + + /* Free memory and use ZEND_ADD_CHAR in case of 1 character strings */ + efree(Z_UNIVAL(op2->u.constant).v); + ZVAL_LONG(&op2->u.constant, ch); + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + opline->opcode = ZEND_ADD_CHAR; + } else { /* String can be empty after a variable at the end of a heredoc */ + efree(Z_UNIVAL(op2->u.constant).v); + return; + } opline->op1 = *op1; opline->op2 = *op2; opline->op2.op_type = IS_CONST; @@ -4154,33 +4154,6 @@ } -void zend_do_end_heredoc(TSRMLS_D) -{ - int opline_num = get_next_op_number(CG(active_op_array))-1; - zend_op *opline = &CG(active_op_array)->opcodes[opline_num]; - - if (opline->opcode != ZEND_ADD_STRING) { - return; - } - - if (Z_TYPE(opline->op2.u.constant) == IS_UNICODE) { - Z_USTRVAL(opline->op2.u.constant)[(Z_USTRLEN(opline->op2.u.constant)--)-1] = 0; - if (Z_USTRLEN(opline->op2.u.constant)>0) { - if (Z_USTRVAL(opline->op2.u.constant)[Z_USTRLEN(opline->op2.u.constant)-1]=='\r') { - Z_USTRVAL(opline->op2.u.constant)[(Z_USTRLEN(opline->op2.u.constant)--)-1] = 0; - } - } - } else { - Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0; - if (Z_STRLEN(opline->op2.u.constant)>0) { - if (Z_STRVAL(opline->op2.u.constant)[Z_STRLEN(opline->op2.u.constant)-1]=='\r') { - Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0; - } - } - } -} - - void zend_do_exit(znode *result, znode *message TSRMLS_DC) { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); @@ -4425,12 +4398,12 @@ { int retval; -again: if (CG(increment_lineno)) { CG(zend_lineno)++; CG(increment_lineno) = 0; } +again: Z_TYPE(zendlval->u.constant) = IS_LONG; retval = lex_scan(&zendlval->u.constant TSRMLS_CC); switch (retval) { @@ -4441,8 +4414,7 @@ goto again; case T_CLOSE_TAG: - if (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1]=='\n' - || (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-2]=='\r' && LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1])) { + if (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1] != '>') { CG(increment_lineno) = 1; } retval = ';'; /* implicit ; */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.h?r1=1.356&r2=1.357&diff_format=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.356 ZendEngine2/zend_
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c /ext/tokenizer/tests 002.phpt 003.phpt bug26463.phpt
johannesSun Apr 8 00:17:40 2007 UTC Modified files: /php-src/ext/tokenizer tokenizer.c /php-src/ext/tokenizer/tests002.phpt 003.phpt bug26463.phpt Log: - Added linenumbers to array returned by token_get_all() http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.40&r2=1.41&diff_format=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.40 php-src/ext/tokenizer/tokenizer.c:1.41 --- php-src/ext/tokenizer/tokenizer.c:1.40 Fri Jan 12 12:16:36 2007 +++ php-src/ext/tokenizer/tokenizer.c Sun Apr 8 00:17:40 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.40 2007/01/12 12:16:36 tony2001 Exp $ */ +/* $Id: tokenizer.c,v 1.41 2007/04/08 00:17:40 johannes Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -272,6 +272,7 @@ zval *keyword; int token_type; zend_bool destroy; + int token_line = 1; CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; @@ -301,6 +302,7 @@ } else { add_next_index_stringl(keyword, zendtext, zendleng, 1); } + add_next_index_long(keyword, token_line); add_next_index_zval(return_value, keyword); } else { add_next_index_stringl(return_value, zendtext, zendleng, 1); @@ -309,6 +311,8 @@ zval_dtor(&token); } ZVAL_NULL(&token); + + token_line = CG(zend_lineno); } } http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tests/002.phpt?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/tokenizer/tests/002.phpt diff -u php-src/ext/tokenizer/tests/002.phpt:1.7 php-src/ext/tokenizer/tests/002.phpt:1.8 --- php-src/ext/tokenizer/tests/002.phpt:1.7Tue Jun 20 18:14:12 2006 +++ php-src/ext/tokenizer/tests/002.phptSun Apr 8 00:17:40 2007 @@ -22,765 +22,959 @@ --EXPECT-- array(49) { [0]=> - array(2) { + array(3) { [0]=> int(370) [1]=> string(2) " +int(1) } [1]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [2]=> - array(2) { + array(3) { [0]=> int(318) [1]=> string(4) "echo" +[2]=> +int(1) } [3]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [4]=> - array(2) { + array(3) { [0]=> int(307) [1]=> string(1) "1" +[2]=> +int(1) } [5]=> string(1) ";" [6]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [7]=> - array(2) { + array(3) { [0]=> int(303) [1]=> string(2) "if" +[2]=> +int(1) } [8]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [9]=> string(1) "(" [10]=> - array(2) { + array(3) { [0]=> int(352) [1]=> string(5) "isset" +[2]=> +int(1) } [11]=> string(1) "(" [12]=> - array(2) { + array(3) { [0]=> int(311) [1]=> string(2) "$a" +[2]=> +int(1) } [13]=> string(1) ")" [14]=> string(1) ")" [15]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [16]=> - array(2) { + array(3) { [0]=> int(266) [1]=> string(5) "print" +[2]=> +int(1) } [17]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [18]=> - array(2) { + array(3) { [0]=> int(311) [1]=> string(2) "$a" +[2]=> +int(1) } [19]=> string(1) "+" [20]=> - array(2) { + array(3) { [0]=> int(307) [1]=> string(1) "1" +[2]=> +int(1) } [21]=> string(1) ";" [22]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [23]=> - array(2) { + array(3) { [0]=> int(311) [1]=> string(2) "$a" +[2]=> +int(1) } [24]=> - array(2) { + array(3) { [0]=> int(299) [1]=> string(2) "++" +[2]=> +int(1) } [25]=> string(1) ";" [26]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +int(1) } [27]=> - array(2) { + array(3) { [0]=> int(311) [1]=> string(2) "$a" +[2]=> +int(1) } [28]=> - array(2) { + array(3) { [0]=> int(298) [1]=> string(2) "--" +[2]=> +int(1) } [29]=> string(1) ";" [30]=> - array(2) { + array(3) { [0]=> int(373) [1]=> string(1) " " +[2]=> +
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
sniper Thu Nov 10 02:49:42 2005 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Fixed bug #35179 (tokenizer extension needs T_HALT_COMPILER) http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.33&r2=1.34&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.33 php-src/ext/tokenizer/tokenizer.c:1.34 --- php-src/ext/tokenizer/tokenizer.c:1.33 Fri Oct 21 05:33:04 2005 +++ php-src/ext/tokenizer/tokenizer.c Thu Nov 10 02:49:40 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.33 2005/10/21 09:33:04 dmitry Exp $ */ +/* $Id: tokenizer.c,v 1.34 2005/11/10 07:49:40 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -282,7 +282,8 @@ REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT); - + REGISTER_LONG_CONSTANT("T_HALT_COMPILER", T_HALT_COMPILER, CONST_CS | CONST_PERSISTENT); + return SUCCESS; } /* }}} */ @@ -497,6 +498,7 @@ case T_THROW: return "T_THROW"; case T_TRY: return "T_TRY"; case T_CLONE: return "T_CLONE"; + case T_HALT_COMPILER: return "T_HALT_COMPILER"; } return "UNKNOWN"; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c ZendEngine2 zend_language_scanner.l
dmitry Fri Oct 21 05:33:04 2005 EDT Modified files: /ZendEngine2zend_language_scanner.l /php-src/ext/tokenizer tokenizer.c Log: Fixed bug #34782 (token_get_all() gives wrong result) http://cvs.php.net/diff.php/ZendEngine2/zend_language_scanner.l?r1=1.134&r2=1.135&ty=u Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.134 ZendEngine2/zend_language_scanner.l:1.135 --- ZendEngine2/zend_language_scanner.l:1.134 Wed Aug 24 16:42:07 2005 +++ ZendEngine2/zend_language_scanner.l Fri Oct 21 05:33:04 2005 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: zend_language_scanner.l,v 1.134 2005/08/24 20:42:07 andrei Exp $ */ +/* $Id: zend_language_scanner.l,v 1.135 2005/10/21 09:33:04 dmitry Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -1005,6 +1005,7 @@ if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { return FAILURE; } + BEGIN(INITIAL); zend_highlight(syntax_highlighter_ini TSRMLS_CC); zend_restore_lexical_state(&original_lex_state TSRMLS_CC); zval_dtor(str); http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.32&r2=1.33&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.32 php-src/ext/tokenizer/tokenizer.c:1.33 --- php-src/ext/tokenizer/tokenizer.c:1.32 Mon Aug 15 10:41:31 2005 +++ php-src/ext/tokenizer/tokenizer.c Fri Oct 21 05:33:04 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.32 2005/08/15 14:41:31 dmitry Exp $ */ +/* $Id: tokenizer.c,v 1.33 2005/10/21 09:33:04 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -521,6 +521,8 @@ RETURN_EMPTY_STRING(); } + LANG_SCNG(start) = 1; + tokenize(return_value TSRMLS_CC); zend_restore_lexical_state(&original_lex_state TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
dmitry Mon Aug 15 10:41:31 2005 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: Fixed memory leak http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.31&r2=1.32&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.31 php-src/ext/tokenizer/tokenizer.c:1.32 --- php-src/ext/tokenizer/tokenizer.c:1.31 Wed Aug 3 10:08:19 2005 +++ php-src/ext/tokenizer/tokenizer.c Mon Aug 15 10:41:31 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.31 2005/08/03 14:08:19 sniper Exp $ */ +/* $Id: tokenizer.c,v 1.32 2005/08/15 14:41:31 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -337,6 +337,8 @@ int token_type; zend_bool destroy; + CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; + array_init(return_value); ZVAL_NULL(&token); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
derick Mon Mar 8 03:02:05 2004 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Fixed bug #24550 (tokenizing with __METHOD__ crash) (Patch by Greg Beaver) http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.28&r2=1.29&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.28 php-src/ext/tokenizer/tokenizer.c:1.29 --- php-src/ext/tokenizer/tokenizer.c:1.28 Tue Mar 2 12:51:46 2004 +++ php-src/ext/tokenizer/tokenizer.c Mon Mar 8 03:02:02 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.28 2004/03/02 17:51:46 derick Exp $ */ +/* $Id: tokenizer.c,v 1.29 2004/03/08 08:02:02 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -257,6 +257,7 @@ REGISTER_LONG_CONSTANT("T_ARRAY", T_ARRAY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLASS_C", T_CLASS_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_FUNC_C", T_FUNC_C, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_METHOD_C", T_METHOD_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_COMMENT", T_COMMENT, CONST_CS | CONST_PERSISTENT); @@ -470,6 +471,7 @@ case T_ARRAY: return "T_ARRAY"; case T_CLASS_C: return "T_CLASS_C"; case T_FUNC_C: return "T_FUNC_C"; + case T_METHOD_C: return "T_METHOD_C"; case T_LINE: return "T_LINE"; case T_FILE: return "T_FILE"; case T_COMMENT: return "T_COMMENT"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
derick Tue Mar 2 12:51:47 2004 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - CLONE, not CLOSE http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.27&r2=1.28&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.27 php-src/ext/tokenizer/tokenizer.c:1.28 --- php-src/ext/tokenizer/tokenizer.c:1.27 Tue Mar 2 12:49:49 2004 +++ php-src/ext/tokenizer/tokenizer.c Tue Mar 2 12:51:46 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.27 2004/03/02 17:49:49 derick Exp $ */ +/* $Id: tokenizer.c,v 1.28 2004/03/02 17:51:46 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -280,7 +280,7 @@ REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLOSE", T_CLONE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT); return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
derick Tue Mar 2 12:49:49 2004 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Added "clone" to the list of tokens. (Patch by Greg Beaver) http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.26&r2=1.27&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.26 php-src/ext/tokenizer/tokenizer.c:1.27 --- php-src/ext/tokenizer/tokenizer.c:1.26 Tue Feb 10 09:40:39 2004 +++ php-src/ext/tokenizer/tokenizer.c Tue Mar 2 12:49:49 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.26 2004/02/10 14:40:39 jan Exp $ */ +/* $Id: tokenizer.c,v 1.27 2004/03/02 17:49:49 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -280,6 +280,7 @@ REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_CLOSE", T_CLONE, CONST_CS | CONST_PERSISTENT); return SUCCESS; } @@ -491,6 +492,7 @@ case T_PUBLIC: return "T_PUBLIC"; case T_THROW: return "T_THROW"; case T_TRY: return "T_TRY"; + case T_CLONE: return "T_CLONE"; } return "UNKNOWN"; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
jan Tue Feb 10 09:40:40 2004 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - fix #27197 for Greg ([EMAIL PROTECTED]) http://cvs.php.net/diff.php/php-src/ext/tokenizer/tokenizer.c?r1=1.25&r2=1.26&ty=u Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.25 php-src/ext/tokenizer/tokenizer.c:1.26 --- php-src/ext/tokenizer/tokenizer.c:1.25 Sat Jan 17 12:44:27 2004 +++ php-src/ext/tokenizer/tokenizer.c Tue Feb 10 09:40:39 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.25 2004/01/17 17:44:27 andrey Exp $ */ +/* $Id: tokenizer.c,v 1.26 2004/02/10 14:40:39 jan Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -345,6 +345,7 @@ case T_OPEN_TAG_WITH_ECHO: case T_WHITESPACE: case T_COMMENT: + case T_DOC_COMMENT: case T_CLOSE_TAG: destroy = 0; break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c /ext/xml xml.c
andrey Sat Jan 17 12:44:28 2004 EDT Modified files: /php-src/ext/xmlxml.c /php-src/ext/tokenizer tokenizer.c Log: HEAD is bundled with ZE2 Index: php-src/ext/xml/xml.c diff -u php-src/ext/xml/xml.c:1.146 php-src/ext/xml/xml.c:1.147 --- php-src/ext/xml/xml.c:1.146 Fri Jan 16 14:11:33 2004 +++ php-src/ext/xml/xml.c Sat Jan 17 12:44:26 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: xml.c,v 1.146 2004/01/16 19:11:33 sniper Exp $ */ +/* $Id: xml.c,v 1.147 2004/01/17 17:44:26 andrey Exp $ */ #define IS_EXT_MODULE @@ -1133,11 +1133,9 @@ ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); /* please leave this commented - or ask [EMAIL PROTECTED] before doing it (again) */ -#ifdef ZEND_ENGINE_2 if (parser->object) { zval_ptr_dtor(&parser->object); } -#endif parser->object = *mythis; Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.24 php-src/ext/tokenizer/tokenizer.c:1.25 --- php-src/ext/tokenizer/tokenizer.c:1.24 Thu Jan 8 03:17:42 2004 +++ php-src/ext/tokenizer/tokenizer.c Sat Jan 17 12:44:27 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.24 2004/01/08 08:17:42 andi Exp $ */ +/* $Id: tokenizer.c,v 1.25 2004/01/17 17:44:27 andrey Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -237,9 +237,6 @@ REGISTER_LONG_CONSTANT("T_DEFAULT", T_DEFAULT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_BREAK", T_BREAK, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CONTINUE", T_CONTINUE, CONST_CS | CONST_PERSISTENT); -#ifndef ZEND_ENGINE_2 - REGISTER_LONG_CONSTANT("T_OLD_FUNCTION", T_OLD_FUNCTION, CONST_CS | CONST_PERSISTENT); -#endif REGISTER_LONG_CONSTANT("T_FUNCTION", T_FUNCTION, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CONST", T_CONST, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_RETURN", T_RETURN, CONST_CS | CONST_PERSISTENT); @@ -252,10 +249,8 @@ REGISTER_LONG_CONSTANT("T_EMPTY", T_EMPTY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLASS", T_CLASS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT); -#ifdef ZEND_ENGINE_2 REGISTER_LONG_CONSTANT("T_INTERFACE", T_INTERFACE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT); -#endif REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT); @@ -276,7 +271,6 @@ REGISTER_LONG_CONSTANT("T_CURLY_OPEN", T_CURLY_OPEN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_PAAMAYIM_NEKUDOTAYIM", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); -#ifdef ZEND_ENGINE_2 REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CATCH", T_CATCH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT); @@ -286,7 +280,6 @@ REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); -#endif return SUCCESS; } @@ -455,9 +448,6 @@ case T_DEFAULT: return "T_DEFAULT"; case T_BREAK: return "T_BREAK"; case T_CONTINUE: return "T_CONTINUE"; -#ifndef ZEND_ENGINE_2 - case T_OLD_FUNCTION: return "T_OLD_FUNCTION"; -#endif case T_FUNCTION: return "T_FUNCTION"; case T_CONST: return "T_CONST"; case T_RETURN: return "T_RETURN"; @@ -470,10 +460,8 @@ case T_EMPTY: return "T_EMPTY"; case T_CLASS: return "T_CLASS"; case T_EXTENDS: return "T_EXTENDS"; -#ifdef ZEND_ENGINE_2 case T_INTERFACE: return "T_INTERFACE"; case T_IMPLEMENTS: return "T_IMPLEMENTS"; -#endif case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR"; case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; case T_LIST: return "T_LIST"; @@ -492,7 +480,6 @@ case T_DOLLAR_OPEN_CURLY_BRACES: return "T_DOLLAR_OPEN_CURLY_BRACES"; case T_CURLY_OPEN: return "T_CURLY_OPEN"; case T_PAAMAYIM_NEKUDOTAYIM: return "T_DOUBL
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
iliaa Sat Nov 29 13:22:45 2003 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: Fixed a memory leak when tokenizing scripts with heredoc. Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.21 php-src/ext/tokenizer/tokenizer.c:1.22 --- php-src/ext/tokenizer/tokenizer.c:1.21 Sat Jul 19 14:52:49 2003 +++ php-src/ext/tokenizer/tokenizer.c Sat Nov 29 13:22:44 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tokenizer.c,v 1.21 2003/07/19 18:52:49 andrey Exp $ */ +/* $Id: tokenizer.c,v 1.22 2003/11/29 18:22:44 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -369,6 +369,9 @@ if (destroy && Z_TYPE(token) != IS_NULL) { zval_dtor(&token); } + if (token_type == T_END_HEREDOC) { + efree(Z_STRVAL(token)); + } ZVAL_NULL(&token); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/tokenizer tokenizer.c
derick Sat Jul 5 02:49:57 2003 EDT Modified files: /php-src/ext/tokenizer tokenizer.c Log: - Fixed bug #24504: T_INTERFACE and T_IMPLEMENTS not defined in tokenizer extension Index: php-src/ext/tokenizer/tokenizer.c diff -u php-src/ext/tokenizer/tokenizer.c:1.19 php-src/ext/tokenizer/tokenizer.c:1.20 --- php-src/ext/tokenizer/tokenizer.c:1.19 Tue Jun 10 16:03:39 2003 +++ php-src/ext/tokenizer/tokenizer.c Sat Jul 5 02:49:57 2003 @@ -250,6 +250,10 @@ REGISTER_LONG_CONSTANT("T_EMPTY", T_EMPTY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLASS", T_CLASS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT); +#ifdef ZEND_ENGINE_2 + REGISTER_LONG_CONSTANT("T_INTERFACE", T_INTERFACE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT); @@ -459,6 +463,10 @@ case T_EMPTY: return "T_EMPTY"; case T_CLASS: return "T_CLASS"; case T_EXTENDS: return "T_EXTENDS"; +#ifdef ZEND_ENGINE_2 + case T_INTERFACE: return "T_INTERFACE"; + case T_IMPLEMENTS: return "T_IMPLEMENTS"; +#endif case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR"; case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; case T_LIST: return "T_LIST"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php