This commit is contained in:
parent
e5baba175b
commit
df92f55df6
3 changed files with 8 additions and 6 deletions
|
@ -6,7 +6,6 @@ import (
|
||||||
|
|
||||||
"git.urbach.dev/cli/q/src/build"
|
"git.urbach.dev/cli/q/src/build"
|
||||||
"git.urbach.dev/cli/q/src/compiler"
|
"git.urbach.dev/cli/q/src/compiler"
|
||||||
"git.urbach.dev/cli/q/src/scanner"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// _build parses the arguments and creates a build.
|
// _build parses the arguments and creates a build.
|
||||||
|
@ -17,7 +16,7 @@ func _build(args []string) int {
|
||||||
return exit(err)
|
return exit(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = compiler.Compile(scanner.Scan(b))
|
_, err = compiler.Compile(b)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return exit(err)
|
return exit(err)
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package compiler
|
package compiler
|
||||||
|
|
||||||
import "git.urbach.dev/cli/q/src/scanner"
|
import (
|
||||||
|
"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.
|
// Compile waits for the scan to finish and compiles all functions.
|
||||||
func Compile(scan scanner.Result) (Result, error) {
|
func Compile(b *build.Build) (Result, error) {
|
||||||
|
scanner.Scan(b)
|
||||||
return Result{}, nil
|
return Result{}, nil
|
||||||
}
|
}
|
|
@ -5,12 +5,11 @@ import (
|
||||||
|
|
||||||
"git.urbach.dev/cli/q/src/build"
|
"git.urbach.dev/cli/q/src/build"
|
||||||
"git.urbach.dev/cli/q/src/compiler"
|
"git.urbach.dev/cli/q/src/compiler"
|
||||||
"git.urbach.dev/cli/q/src/scanner"
|
|
||||||
"git.urbach.dev/go/assert"
|
"git.urbach.dev/go/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCompile(t *testing.T) {
|
func TestCompile(t *testing.T) {
|
||||||
b := build.New("../../examples/hello")
|
b := build.New("../../examples/hello")
|
||||||
_, err := compiler.Compile(scanner.Scan(b))
|
_, err := compiler.Compile(b)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue