Implemented a basic scanner
All checks were successful
/ test (push) Successful in 17s

This commit is contained in:
Eduard Urbach 2025-06-19 15:17:50 +02:00
parent df92f55df6
commit 154893d9f7
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
19 changed files with 410 additions and 11 deletions

View file

@ -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
}