cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y
| From: | Zeev Suraski | Date: | Sun, 08 Dec 2002 14:09:43 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-693@lists.php.net to get a copy of this message | ||
zeev Sun Dec 8 09:09:43 2002 EDT
Modified files:
/ZendEngine2 zend_compile.c zend_compile.h zend_language_parser.y
Log:
Treat the absence of an access type just as if 'public' was supplied
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.331 ZendEngine2/zend_compile.c:1.332
--- ZendEngine2/zend_compile.c:1.331 Sat Dec 7 16:46:12 2002
+++ ZendEngine2/zend_compile.c Sun Dec 8 09:09:43 2002
@@ -912,7 +912,7 @@
int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier)
{
- if (current_access_type->u.constant.value.lval & ZEND_FN_PPP_MASK) {
+ if (current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) {
zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
}
return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval);
Index: ZendEngine2/zend_compile.h
diff -u ZendEngine2/zend_compile.h:1.198 ZendEngine2/zend_compile.h:1.199
--- ZendEngine2/zend_compile.h:1.198 Fri Dec 6 12:09:44 2002
+++ ZendEngine2/zend_compile.h Sun Dec 8 09:09:43 2002
@@ -97,10 +97,7 @@
#define ZEND_ACC_PUBLIC 0x10
#define ZEND_ACC_PROTECTED 0x20
#define ZEND_ACC_PRIVATE 0x40
-
-/* AND mask for accessing only public/protected/private of fn_flags
- */
-#define ZEND_FN_PPP_MASK 0xF0
+#define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE)
char *zend_visibility_string(zend_uint fn_flags);
Index: ZendEngine2/zend_language_parser.y
diff -u ZendEngine2/zend_language_parser.y:1.81 ZendEngine2/zend_language_parser.y:1.82
--- ZendEngine2/zend_language_parser.y:1.81 Sat Dec 7 10:52:08 2002
+++ ZendEngine2/zend_language_parser.y Sun Dec 8 09:09:43 2002
@@ -456,8 +456,8 @@
;
method_modifiers:
- /* empty */ { $$.u.constant.value.lval = 0; }
- | non_empty_method_modifiers { $$ = $1; }
+ /* empty */ { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; }
+ | non_empty_method_modifiers { $$ = $1; if (!($$.u.constant.value.lval &
ZEND_ACC_PPP_MASK)) { $$.u.constant.value.lval |= ZEND_ACC_PUBLIC; } }
;
non_empty_method_modifiers: