summaryrefslogtreecommitdiff
path: root/Zend/zend_language_parser.y
diff options
context:
space:
mode:
authorMárcio Almada <marcio3w@gmail.com>2015-03-07 17:59:20 -0300
committerMárcio Almada <marcio3w@gmail.com>2015-03-08 12:50:57 -0300
commit22d6cc7c8c9485f90ab8356d1f51caa20de1c088 (patch)
tree268fae3368857c1b52c10e454933180eeeb6c4af /Zend/zend_language_parser.y
parent072d1dad1578149b1bf0c5bd2748dca167d46d46 (diff)
downloadphp-git-22d6cc7c8c9485f90ab8356d1f51caa20de1c088.tar.gz
fix compilation warnings, rename batch_use to group_use
Diffstat (limited to 'Zend/zend_language_parser.y')
-rw-r--r--Zend/zend_language_parser.y33
1 files changed, 17 insertions, 16 deletions
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index a9a93b86a6..69544ecf04 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -229,8 +229,8 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%type <ast> top_statement namespace_name name statement function_declaration_statement
%type <ast> class_declaration_statement trait_declaration_statement
%type <ast> interface_declaration_statement interface_extends_list
-%type <ast> batch_use_declarations inline_use_declarations inline_use_declaration
-%type <ast> mixed_batch_use_declarations use_declaration const_decl inner_statement
+%type <ast> group_use_declaration inline_use_declarations inline_use_declaration
+%type <ast> mixed_group_use_declaration use_declaration const_decl inner_statement
%type <ast> expr optional_expr while_statement for_statement foreach_variable
%type <ast> foreach_statement declare_statement finally_statement unset_variable variable
%type <ast> extends_from parameter optional_type argument expr_without_variable global_var
@@ -253,7 +253,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%type <num> returns_ref function is_reference is_variadic variable_modifiers
%type <num> method_modifiers trait_modifiers non_empty_member_modifiers member_modifier
-%type <num> class_modifiers class_modifier
+%type <num> class_modifiers class_modifier use_type
%type <str> backup_doc_comment
@@ -298,23 +298,29 @@ top_statement:
| T_NAMESPACE { RESET_DOC_COMMENT(); }
'{' top_statement_list '}'
{ $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
- | T_USE mixed_batch_use_declarations ';' { $$ = $2; }
- | T_USE T_FUNCTION batch_use_declarations ';' { $$ = $3; $3->attr = T_FUNCTION; }
- | T_USE T_CONST batch_use_declarations ';' { $$ = $3; $3->attr = T_CONST; }
+ | T_USE mixed_group_use_declaration ';' { $$ = $2; }
+ | T_USE T_FUNCTION group_use_declaration ';' { $$ = $3; $$->attr = T_FUNCTION; }
+ | T_USE T_CONST group_use_declaration ';' { $$ = $3; $$->attr = T_CONST; }
| T_USE use_declarations ';' { $$ = $2; $$->attr = T_CLASS; }
| T_USE T_FUNCTION use_declarations ';' { $$ = $3; $$->attr = T_FUNCTION; }
| T_USE T_CONST use_declarations ';' { $$ = $3; $$->attr = T_CONST; }
| T_CONST const_list ';' { $$ = $2; }
;
-batch_use_declarations:
+use_type:
+ /* empty */ { $$ = T_CLASS; }
+ | T_FUNCTION { $$ = T_FUNCTION; }
+ | T_CONST { $$ = T_CONST; }
+;
+
+group_use_declaration:
namespace_name T_NS_SEPARATOR '{' use_declarations '}'
- {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $4); }
+ {$$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4); }
;
-mixed_batch_use_declarations:
+mixed_group_use_declaration:
namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
- {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $4);}
+ {$$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4);}
;
inline_use_declarations:
@@ -325,12 +331,7 @@ inline_use_declarations:
;
inline_use_declaration:
- use_declaration
- { $$ = $1; $$->attr = T_CLASS; }
- | T_FUNCTION use_declaration
- { $$ = $2; $$->attr = T_FUNCTION; }
- | T_CONST use_declaration
- { $$ = $2; $$->attr = T_CONST; }
+ use_type use_declaration { $$ = $2; $$->attr = $1; }
;
use_declarations: