feat: 多返回值 fn f(...) -> (T, U) { return (e1, e2); }

Parser: -> (T1,T2) 解析为隐式 struct __ret_funcname, return (e1,e2) 去糖为 struct init
返回的 struct 可访问字段 _0, _1, ... 无 sema/codegen 改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 14:07:13 +08:00
parent 06c8773fac
commit 71208a87f4
4 changed files with 114 additions and 9 deletions
+3
View File
@@ -41,6 +41,9 @@ AstNode* ast_make_function(void* alloc, const char* name, AstNode** params, size
n->as.function.is_pub = is_pub;
n->as.function.type_params = type_params;
n->as.function.type_param_count = tp_count;
n->as.function.multi_ret_types = NULL;
n->as.function.multi_ret_snames = NULL;
n->as.function.multi_ret_count = 0;
return n;
}