Separated compiler into its own package

This commit is contained in:
Eduard Urbach 2024-07-18 10:08:38 +02:00
parent 38043ca12a
commit 61dc691c65
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 199 additions and 167 deletions

View file

@ -4,7 +4,7 @@ import (
"path/filepath"
"strings"
"git.akyoto.dev/cli/q/src/build/core"
"git.akyoto.dev/cli/q/src/build/compiler"
"git.akyoto.dev/cli/q/src/build/scanner"
)
@ -21,9 +21,9 @@ func New(files ...string) *Build {
}
// Run parses the input files and generates an executable file.
func (build *Build) Run() (core.Result, error) {
func (build *Build) Run() (compiler.Result, error) {
functions, errors := scanner.Scan(build.Files)
return core.Compile(functions, errors)
return compiler.Compile(functions, errors)
}
// Executable returns the path to the executable.