Implemented package imports

This commit is contained in:
Eduard Urbach 2024-07-18 18:08:30 +02:00
parent 3e5adff5e5
commit fcc4f8d2d9
Signed by: eduard
GPG key ID: 49226B848C78F6C8
21 changed files with 510 additions and 353 deletions

View file

@ -0,0 +1,24 @@
package scanner
import (
"path/filepath"
"strings"
"git.akyoto.dev/cli/q/src/build/fs"
)
// queueDirectory queues an entire directory to be scanned.
func (s *Scanner) queueDirectory(directory string, pkg string) {
err := fs.Walk(directory, func(name string) {
if !strings.HasSuffix(name, ".q") {
return
}
fullPath := filepath.Join(directory, name)
s.queueFile(fullPath, pkg)
})
if err != nil {
s.errors <- err
}
}