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:
@@ -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 "?";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user