cvs: ZendEngine2 / zend_compile.c zend_language_scanner.h zend_language_scanner.l

From: Date: Sun, 11 Jan 2004 19:27:14 +0000
Subject: cvs: ZendEngine2 / zend_compile.c zend_language_scanner.h zend_language_scanner.l
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2200@lists.php.net to get a copy of this message
andi Sun Jan 11 14:27:14 2004 EDT Modified files: /ZendEngine2 zend_compile.c zend_language_scanner.h zend_language_scanner.l Log: - This should fix the problem of conditional function decleration on the - same line of code not to work. You should re-evaluate your coding style - if you really code this way :) Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.510 ZendEngine2/zend_compile.c:1.511 --- ZendEngine2/zend_compile.c:1.510 Fri Jan 9 09:02:33 2004 +++ ZendEngine2/zend_compile.c Sun Jan 11 14:27:13 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.510 2004/01/09 14:02:33 stas Exp $ */ +/* $Id: zend_compile.c,v 1.511 2004/01/11 19:27:13 andi Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -62,29 +62,29 @@ free(property_info->name); } -static void build_runtime_defined_function_key(zval *result, char *name, int name_length, zend_op *opline TSRMLS_DC) +static void build_runtime_defined_function_key(zval *result, char *name, int name_length TSRMLS_DC) { - char lineno_buf[32]; - uint lineno_len; + char char_pos_buf[32]; + uint char_pos_len; char *filename; - lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno); + char_pos_len = zend_sprintf(char_pos_buf, "%x", zend_get_last_accepting_character_position()); if (CG(active_op_array)->filename) { filename = CG(active_op_array)->filename; } else { filename = "-"; } - /* NULL, name length, filename length, line number length */ - result->value.str.len = 1+name_length+strlen(filename)+lineno_len; + /* NULL, name length, filename length, last accepting char position length */ + result->value.str.len = 1+name_length+strlen(filename)+char_pos_len; result->value.str.val = (char *) emalloc(result->value.str.len+1); #ifdef ZEND_MULTIBYTE /* must be binary safe */ result->value.str.val[0] = '\0'; memcpy(result->value.str.val+1, name, name_length); - sprintf(result->value.str.val+1+name_length, "%s%s", filename, lineno_buf); + sprintf(result->value.str.val+1+name_length, "%s%s", filename, char_pos_buf); #else - sprintf(result->value.str.val, "%c%s%s%s", '\0', name, filename, lineno_buf); + sprintf(result->value.str.val, "%c%s%s%s", '\0', name, filename, char_pos_buf); #endif /* ZEND_MULTIBYTE */ result->type = IS_STRING; result->refcount = 1; @@ -1052,7 +1052,7 @@ opline->opcode = ZEND_DECLARE_FUNCTION; opline->op1.op_type = IS_CONST; - build_runtime_defined_function_key(&opline->op1.u.constant, lcname, name_len, opline TSRMLS_CC); + build_runtime_defined_function_key(&opline->op1.u.constant, lcname, name_len TSRMLS_CC); opline->op2.op_type = IS_CONST; opline->op2.u.constant.type = IS_STRING; opline->op2.u.constant.value.str.val = lcname; @@ -2337,7 +2337,7 @@ opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->op1.op_type = IS_CONST; - build_runtime_defined_function_key(&opline->op1.u.constant, lcname, new_class_entry->name_length, opline TSRMLS_CC); + build_runtime_defined_function_key(&opline->op1.u.constant, lcname, new_class_entry->name_length TSRMLS_CC); opline->op2.op_type = IS_CONST; opline->op2.u.constant.type = IS_STRING; Index: ZendEngine2/zend_language_scanner.h diff -u ZendEngine2/zend_language_scanner.h:1.15 ZendEngine2/zend_language_scanner.h:1.16 --- ZendEngine2/zend_language_scanner.h:1.15 Thu Jan 8 12:31:47 2004 +++ ZendEngine2/zend_language_scanner.h Sun Jan 11 14:27:13 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.h,v 1.15 2004/01/08 17:31:47 sniper Exp $ */ +/* $Id: zend_language_scanner.h,v 1.16 2004/01/11 19:27:13 andi Exp $ */ #ifndef ZEND_SCANNER_H #define ZEND_SCANNER_H @@ -53,6 +53,8 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); +char *zend_get_last_accepting_character_position(); + END_EXTERN_C() #endif Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.99 ZendEngine2/zend_language_scanner.l:1.100 --- ZendEngine2/zend_language_scanner.l:1.99 Thu Jan 8 03:23:23 2004 +++ ZendEngine2/zend_language_scanner.l Sun Jan 11 14:27:13 2004 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.l,v 1.99 2004/01/08 08:23:23 andi Exp $ */ +/* $Id: zend_language_scanner.l,v 1.100 2004/01/11 19:27:13 andi Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -178,6 +178,10 @@ #endif /* ZEND_MULTIBYTE */ } +char *zend_get_last_accepting_character_position() +{ + return SCNG(_yy_last_accepting_cpos); +} ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) {

« previous php.zend-engine.cvs (#2200) next »