Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y
| From: | (Marcus Börger) | Date: | Sun, 09 Mar 2003 21:18:59 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y | ||
| References: | 1 2 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1031@lists.php.net to get a copy of this message | ||
At 22:13 09.03.2003, Andi Gutmans wrote:
At 10:10 PM 3/9/2003 +0100, Marcus Börger wrote:While you're at it: Here is the patch to allow "__NAMESPACE__" again :-) cvs -z3 -q diff zend_language_scanner.l (in directory S:\php4-HEAD\Zend\) Index: zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.80 diff -u -r1.80 zend_language_scanner.lnamespaces are still translated from ':' to '_'. I think this is first not necessary and second it causes errors when a user has both (example 'a:b' and 'a_b').I nuked it.
--- zend_language_scanner.l 9 Mar 2003 21:12:12 -0000 1.80 +++ zend_language_scanner.l 9 Mar 2003 21:16:20 -0000@@ -981,6 +981,20 @@
return T_CLASS_C;} +<ST_IN_SCRIPTING>"__NAMESPACE__" {
+ char *namespace_name = NULL;+
+ namespace_name = CG(active_namespace)->name;+
+ if (!namespace_name) {
+ namespace_name = "";
+ }
+ zendlval->value.str.len = strlen(namespace_name);
+ zendlval->value.str.val = estrndup(namespace_name, zendlval->value.str.len);
+ zendlval->type = IS_STRING;
+ return T_CLASS_C;
+}
+
<ST_IN_SCRIPTING>"__FUNCTION__" {
char *func_name = CG(active_op_array)->function_name;p.s.: It would be cool to have ZE2 karma to be able to apply small fixes :-)