Implemented struct pointer types

This commit is contained in:
2025-02-05 15:16:00 +01:00
parent 85568949a2
commit 5d38a4980a
17 changed files with 190 additions and 102 deletions

View File

@ -14,7 +14,18 @@ func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-c
result := Result{}
allFiles := make([]*fs.File, 0, 8)
allFunctions := map[string]*core.Function{}
allTypes := map[string]types.Type{}
allTypes := map[string]types.Type{
"Int": types.Int,
"Int64": types.Int64,
"Int32": types.Int32,
"Int16": types.Int16,
"Int8": types.Int8,
"Float": types.Float,
"Float64": types.Float64,
"Float32": types.Float32,
"Pointer": types.PointerAny,
}
for functions != nil || files != nil || errs != nil {
select {
@ -54,6 +65,15 @@ func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-c
}
}
// Resolve the types
for _, function := range allFunctions {
err := function.ResolveTypes()
if err != nil {
return result, err
}
}
// Start parallel compilation
CompileFunctions(allFunctions)