diff options
Diffstat (limited to 'Zend/zend_ast.c')
| -rw-r--r-- | Zend/zend_ast.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 5ffaabfc68..b1e564b5e9 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1590,6 +1590,7 @@ simple_list: break; case ZEND_AST_SWITCH_LIST: case ZEND_AST_CATCH_LIST: + case ZEND_AST_MATCH_ARM_LIST: zend_ast_export_list(str, (zend_ast_list*)ast, 0, 0, indent); break; case ZEND_AST_CLOSURE_USES: @@ -1967,6 +1968,25 @@ simple_list: } zend_ast_export_stmt(str, ast->child[1], indent + 1); break; + case ZEND_AST_MATCH: + smart_str_appends(str, "match ("); + zend_ast_export_ex(str, ast->child[0], 0, indent); + smart_str_appends(str, ") {\n"); + zend_ast_export_ex(str, ast->child[1], 0, indent + 1); + zend_ast_export_indent(str, indent); + smart_str_appendc(str, '}'); + break; + case ZEND_AST_MATCH_ARM: + zend_ast_export_indent(str, indent); + if (ast->child[0]) { + zend_ast_export_list(str, (zend_ast_list*)ast->child[0], 1, 0, indent); + smart_str_appends(str, " => "); + } else { + smart_str_appends(str, "default => "); + } + zend_ast_export_ex(str, ast->child[1], 0, 0); + smart_str_appends(str, ",\n"); + break; case ZEND_AST_DECLARE: smart_str_appends(str, "declare("); ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_CONST_DECL); |
