;
function_declaration_statement:
- function returns_ref T_STRING '(' parameter_list ')' return_type
- backup_doc_comment '{' inner_statement_list '}'
- { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $8,
- zend_ast_get_str($3), $5, NULL, $10, $7); }
+ function returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type
+ '{' inner_statement_list '}'
+ { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $4,
+ zend_ast_get_str($3), $6, NULL, $10, $8); }
;
is_reference:
{ $$ = $2; RESET_DOC_COMMENT(); }
| T_USE name_list trait_adaptations
{ $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
- | method_modifiers function returns_ref identifier '(' parameter_list ')'
- return_type backup_doc_comment method_body
- { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $9,
- zend_ast_get_str($4), $6, NULL, $10, $8); }
+ | method_modifiers function returns_ref identifier backup_doc_comment '(' parameter_list ')'
+ return_type method_body
+ { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $5,
+ zend_ast_get_str($4), $7, NULL, $10, $9); }
;
name_list:
| T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
| T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
| T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); }
- | function returns_ref '(' parameter_list ')' lexical_vars return_type
- backup_doc_comment '{' inner_statement_list '}'
- { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
+ | function returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type
+ '{' inner_statement_list '}'
+ { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $3,
zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
- $4, $6, $10, $7); }
- | T_STATIC function returns_ref '(' parameter_list ')' lexical_vars
- return_type backup_doc_comment '{' inner_statement_list '}'
- { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $9,
+ $5, $7, $10, $8); }
+ | T_STATIC function returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars
+ return_type '{' inner_statement_list '}'
+ { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $4,
zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
- $5, $7, $11, $8); }
+ $6, $8, $11, $9); }
;
function: