From 66cf76ee5412353b2a070f42dec7fc618f41e8eb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 24 Jun 2018 13:34:32 +0200 Subject: [PATCH] Remove expr_without_variable We no longer need this distinction. --- Zend/zend_language_parser.y | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 59116377167..9e4397aa92b 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -234,7 +234,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %type unprefixed_use_declarations const_decl inner_statement %type expr optional_expr while_statement for_statement foreach_variable %type foreach_statement declare_statement finally_statement unset_variable variable -%type extends_from parameter optional_type argument expr_without_variable global_var +%type extends_from parameter optional_type argument global_var %type static_var class_statement trait_adaptation trait_precedence trait_alias %type absolute_trait_method_reference trait_method_reference property echo_expr %type new_expr anonymous_class class_name class_name_reference simple_variable @@ -871,8 +871,10 @@ new_expr: { $$ = $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); } @@ -1100,11 +1102,6 @@ constant: { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); } ; -expr: - variable { $$ = $1; } - | expr_without_variable { $$ = $1; } -; - optional_expr: /* empty */ { $$ = NULL; } | expr { $$ = $1; }