diff options
| author | Dmitry Stogov <dmitry@php.net> | 2008-11-25 09:56:32 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2008-11-25 09:56:32 +0000 |
| commit | ea45b713c8ed4110e26588fab00730a677106231 (patch) | |
| tree | e3d5f0254b879300c304f2bb3b500c0598e09378 /Zend/zend_language_parser.y | |
| parent | cc2c72091233930ad17d14c8388b4cd272fef112 (diff) | |
| download | php-git-ea45b713c8ed4110e26588fab00730a677106231.tar.gz | |
Added support for namespaces with brackets. (Greg)
Diffstat (limited to 'Zend/zend_language_parser.y')
| -rw-r--r-- | Zend/zend_language_parser.y | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index e613f05abc..7feb689087 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -166,13 +166,17 @@ namespace_name: ; top_statement: - statement - | function_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | class_declaration_statement { zend_do_early_binding(TSRMLS_C); } + statement { zend_verify_namespace(TSRMLS_C); } + | function_declaration_statement { zend_verify_namespace(TSRMLS_C); zend_do_early_binding(TSRMLS_C); } + | class_declaration_statement { zend_verify_namespace(TSRMLS_C); zend_do_early_binding(TSRMLS_C); } | T_HALT_COMPILER '(' ')' ';' { zend_do_halt_compiler_register(TSRMLS_C); YYACCEPT; } - | T_NAMESPACE namespace_name ';' { zend_do_namespace(&$2 TSRMLS_CC); } - | T_USE use_declarations ';' - | constant_declaration ';' + | T_NAMESPACE namespace_name ';' { zend_do_begin_namespace(&$2, 0 TSRMLS_CC); } + | T_NAMESPACE namespace_name '{' { zend_do_begin_namespace(&$2, 1 TSRMLS_CC); } + top_statement_list '}' { zend_do_end_namespace(TSRMLS_C); } + | T_NAMESPACE '{' { zend_do_begin_namespace(NULL, 1 TSRMLS_CC); } + top_statement_list '}' { zend_do_end_namespace(TSRMLS_C); } + | T_USE use_declarations ';' { zend_verify_namespace(TSRMLS_C); } + | constant_declaration ';' { zend_verify_namespace(TSRMLS_C); } ; use_declarations: |
