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

@@ -77,9 +77,6 @@ core_type_to_string(Ast_Type *type) {
String base = core_type_to_string(type->base);
return pctx->fmt("[]%Q", base);
} break;
case TYPE_TUPLE: {
invalid_codepath;
} break;
case TYPE_TYPE: return "Type"_s; break;
case TYPE_UNTYPED_BOOL: return "UntypedBool"_s; break;
@@ -342,10 +339,7 @@ void core__stringify(Ast *ast) {
case AST_RETURN: {
Ast_Return *n = (Ast_Return *)ast;
gen("return ");
For(n->expr) {
core__stringify(it);
if (!n->expr.is_last(it)) gen(", ");
}
core__stringify(n->expr);
} break;
case AST_LAMBDA_EXPR: {
@@ -358,12 +352,8 @@ void core__stringify(Ast *ast) {
}
gen(")");
if (n->ret.len) gen(": ");
For(n->ret) {
core__stringify(it);
if (!n->ret.is_last(it)) gen(", ");
}
if (n->ret) gen(": ");
core__stringify(n->ret);
core__stringify(n->scope);
} break;