Core: Remove AST_Tuple, repurpose VAR_UNPACK (buggy probably)

This commit is contained in:
Krzosa Karol
2023-04-21 22:49:15 +02:00
parent 108ec6121e
commit bbd8b0ab91
12 changed files with 92 additions and 238 deletions

View File

@@ -19,7 +19,6 @@ Ast_Expr *create_typespec_from_type(Token *pos, Ast_Scope *parent_scope, Ast_Typ
Ast_Expr *result = 0;
switch (type->kind) {
case TYPE_NONE:
case TYPE_TUPLE:
case TYPE_COMPLETING:
case TYPE_INCOMPLETE:
case TYPE_POLYMORPH:
@@ -394,11 +393,7 @@ Ast *ast_copy(Ast *ast, Ast_Scope *parent_scope, Array<Poly_Replacement> *repl)
Ast_Return *src = (Ast_Return *)ast;
Ast_Return *dst = ast_create_copy(parent_scope, Ast_Return, ast);
dst->expr.init(pctx->perm, src->expr.len);
For(src->expr) {
auto copy = (Ast_Expr *)ast_copy(it, parent_scope, repl);
dst->expr.add(copy);
}
dst->expr = (Ast_Expr *)ast_copy(src->expr, parent_scope, repl);
result = dst;
} break;
@@ -413,11 +408,7 @@ Ast *ast_copy(Ast *ast, Ast_Scope *parent_scope, Array<Poly_Replacement> *repl)
dst->args.add(copy);
}
dst->ret.init(pctx->perm, src->ret.len);
For(src->ret) {
auto copy = (Ast_Expr *)ast_copy(it, parent_scope, repl);
dst->ret.add(copy);
}
dst->ret = (Ast_Expr *)ast_copy(src->ret, parent_scope, repl);
dst->scope = (Ast_Scope *)ast_copy(src->scope, parent_scope, repl);
result = dst;
} break;