feat(bootstrap): function pointer types + C emission
- Add tekFunc AST node and parser support for func(Params) -> Ret - Add tkFunc type resolution in sema and hir_lower - Add &FuncName address-taking yielding tkMutRef(tkFunc) - Fix C emission: function pointer params use Ret (*name)(Params) syntax via cParamDecl helper that embeds the name inside (*) - Fix forward declarations and temp declarations for function pointers - Add funcPtrTypes table in C backend so &Fn temps get proper type - Add _test_funcptr integration test
This commit is contained in:
@@ -33,6 +33,7 @@ type
|
||||
tekDynRef ## &dyn Trait — trait object (fat pointer)
|
||||
tekTuple
|
||||
tekSelf
|
||||
tekFunc
|
||||
|
||||
TypeExpr* = ref object
|
||||
loc*: SourceLocation
|
||||
@@ -54,6 +55,9 @@ type
|
||||
tupleElements*: seq[TypeExpr]
|
||||
of tekSelf:
|
||||
discard
|
||||
of tekFunc:
|
||||
funcParams*: seq[TypeExpr]
|
||||
funcRet*: TypeExpr
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Patterns
|
||||
|
||||
Reference in New Issue
Block a user