Implemented structs
This commit is contained in:
@ -10,11 +10,11 @@ import (
|
||||
)
|
||||
|
||||
// Compile waits for the scan to finish and compiles all functions.
|
||||
func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-chan *types.Type, errs <-chan error) (Result, error) {
|
||||
func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-chan types.Type, errs <-chan error) (Result, error) {
|
||||
result := Result{}
|
||||
allFiles := make([]*fs.File, 0, 8)
|
||||
allFunctions := map[string]*core.Function{}
|
||||
allTypes := map[string]*types.Type{}
|
||||
allTypes := map[string]types.Type{}
|
||||
|
||||
for functions != nil || files != nil || errs != nil {
|
||||
select {
|
||||
@ -25,6 +25,7 @@ func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-c
|
||||
}
|
||||
|
||||
function.Functions = allFunctions
|
||||
function.Types = allTypes
|
||||
allFunctions[function.UniqueName] = function
|
||||
|
||||
case typ, ok := <-structs:
|
||||
@ -33,7 +34,7 @@ func Compile(files <-chan *fs.File, functions <-chan *core.Function, structs <-c
|
||||
continue
|
||||
}
|
||||
|
||||
allTypes[typ.Name] = typ
|
||||
allTypes[typ.UniqueName()] = typ
|
||||
|
||||
case file, ok := <-files:
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user