This commit is contained in:
parent
df92f55df6
commit
154893d9f7
19 changed files with 410 additions and 11 deletions
|
@ -1,12 +1,36 @@
|
|||
package compiler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.urbach.dev/cli/q/src/build"
|
||||
"git.urbach.dev/cli/q/src/scanner"
|
||||
)
|
||||
|
||||
// Compile waits for the scan to finish and compiles all functions.
|
||||
func Compile(b *build.Build) (Result, error) {
|
||||
scanner.Scan(b)
|
||||
return Result{}, nil
|
||||
result := Result{}
|
||||
files, errors := scanner.Scan(b)
|
||||
|
||||
for files != nil || errors != nil {
|
||||
select {
|
||||
case file, ok := <-files:
|
||||
if !ok {
|
||||
files = nil
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Println(file.Path)
|
||||
|
||||
case err, ok := <-errors:
|
||||
if !ok {
|
||||
errors = nil
|
||||
continue
|
||||
}
|
||||
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue