feat(selfhost): function types (func(Params) -> Ret)

- Add tekFunc AST node and TypeExprList linked list for params
- Parse func(T, U) -> R syntax in parser.bux
- Resolve tekFunc to tyFunc in sema.bux
- Track original TypeExpr via Symbol.refType for params/lets/consts/funcs
- Build C function-pointer type names in hir_lower.bux (Ret (*)(Params))
- Lower indirect calls through function-typed values as hCallIndirect
- Add CBE_CParamDecl helper in c_backend.bux to embed name inside (*)
- Emit hCallIndirect and function-pointer variable declarations
- _test_funcptr now builds and runs with selfhost buxc2
This commit is contained in:
2026-06-08 23:39:15 +03:00
parent 2e536488e6
commit 0c41c7bb25
7 changed files with 305 additions and 78 deletions
+1
View File
@@ -183,6 +183,7 @@ func Type_ToString(t: Type) -> String {
if t.kind == tyNamed { return t.name; }
if t.kind == tyTypeParam { return t.name; }
if t.kind == tyPointer { return String_Concat("*", t.innerName1); }
if t.kind == tyFunc { return t.name; }
return "?";
}
}