%type <ast> unprefixed_use_declarations 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
+%type <ast> extends_from parameter optional_type argument global_var
%type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
%type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
%type <ast> new_expr anonymous_class class_name class_name_reference simple_variable
{ $$ = $2; }
;
-expr_without_variable:
- T_LIST '(' array_pair_list ')' '=' expr
+expr:
+ variable
+ { $$ = $1; }
+ | T_LIST '(' array_pair_list ')' '=' expr
{ $3->attr = ZEND_ARRAY_SYNTAX_LIST; $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
| '[' array_pair_list ']' '=' expr
{ $2->attr = ZEND_ARRAY_SYNTAX_SHORT; $$ = zend_ast_create(ZEND_AST_ASSIGN, $2, $5); }
{ $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
;
-expr:
- variable { $$ = $1; }
- | expr_without_variable { $$ = $1; }
-;
-
optional_expr:
/* empty */ { $$ = NULL; }
| expr { $$ = $1; }