@@ -231,7 +231,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
231231%type <ast> class_declaration_statement trait_declaration_statement
232232%type <ast> interface_declaration_statement interface_extends_list
233233%type <ast> batch_use_declarations inline_use_declarations inline_use_declaration
234- %type <ast> use_declaration const_decl inner_statement
234+ %type <ast> mixed_batch_use_declarations use_declaration const_decl inner_statement
235235%type <ast> expr optional_expr while_statement for_statement foreach_variable
236236%type <ast> foreach_statement declare_statement finally_statement unset_variable variable
237237%type <ast> extends_from parameter optional_type argument expr_without_variable global_var
@@ -300,14 +300,21 @@ top_statement:
300300 | T_NAMESPACE { RESET_DOC_COMMENT(); }
301301 ' {' top_statement_list ' }'
302302 { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL , $4 ); }
303- | T_USE batch_use_declarations ' ;' { $$ = $2 ; }
304- | T_USE use_declarations ' ;' { $$ = $2 ; $$ ->attr = T_CLASS; }
305- | T_USE T_FUNCTION use_declarations ' ;' { $$ = $3 ; $$ ->attr = T_FUNCTION; }
306- | T_USE T_CONST use_declarations ' ;' { $$ = $3 ; $$ ->attr = T_CONST; }
307- | T_CONST const_list ' ;' { $$ = $2 ; }
303+ | T_USE mixed_batch_use_declarations ' ;' { $$ = $2 ; }
304+ | T_USE T_FUNCTION batch_use_declarations ' ;' { $$ = $3 ; $3 ->attr = T_FUNCTION; }
305+ | T_USE T_CONST batch_use_declarations ' ;' { $$ = $3 ; $3 ->attr = T_CONST; }
306+ | T_USE use_declarations ' ;' { $$ = $2 ; $$ ->attr = T_CLASS; }
307+ | T_USE T_FUNCTION use_declarations ' ;' { $$ = $3 ; $$ ->attr = T_FUNCTION; }
308+ | T_USE T_CONST use_declarations ' ;' { $$ = $3 ; $$ ->attr = T_CONST; }
309+ | T_CONST const_list ' ;' { $$ = $2 ; }
308310;
309311
310312batch_use_declarations :
313+ namespace_name ' {' use_declarations ' }'
314+ {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1 , $3 ); }
315+ ;
316+
317+ mixed_batch_use_declarations :
311318 namespace_name ' {' inline_use_declarations ' }'
312319 {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1 , $3 );}
313320;
0 commit comments