Improved tokenizer

This commit is contained in:
Eduard Urbach 2023-10-31 21:13:14 +01:00
parent 5c12992fca
commit c4b28fb66e
No known key found for this signature in database
GPG key ID: C874F672B1AF20C0
10 changed files with 57 additions and 53 deletions

View file

@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
"git.akyoto.dev/cli/q/src/compiler"
"git.akyoto.dev/cli/q/src/elf"
"git.akyoto.dev/cli/q/src/errors"
)
@ -12,7 +13,6 @@ import (
// Build describes a compiler build.
type Build struct {
Directory string
Verbose bool
WriteExecutable bool
}
@ -36,7 +36,7 @@ func (build *Build) Run() error {
return &errors.InvalidDirectory{Path: build.Directory}
}
functions, err := build.Compile()
functions, err := compiler.Compile(build.Directory)
if err != nil {
return err
@ -46,7 +46,7 @@ func (build *Build) Run() error {
return nil
}
code, data := build.Finalize(functions)
code, data := compiler.Finalize(functions)
return writeToDisk(build.Executable(), code, data)
}