Core: Add defer

This commit is contained in:
Krzosa Karol
2023-04-22 14:23:08 +02:00
parent d9a7882f8c
commit ad301153d4
8 changed files with 61 additions and 48 deletions

View File

@@ -322,6 +322,12 @@ Ast *ast_copy(Ast *ast, Ast_Scope *parent_scope, Array<Poly_Replacement> *repl)
result = dst;
} break;
case AST_DEFER: {
Ast_Defer *src = (Ast_Defer *)ast;
Ast_Defer *dst = ast_create_copy(parent_scope, Ast_Defer, ast);
dst->scope = (Ast_Scope *)ast_copy(src->scope, parent_scope, repl);
} break;
case AST_BREAK:
case AST_PASS:
case AST_GOTO: