Improved error handling

This commit is contained in:
Eduard Urbach 2023-11-03 10:42:10 +01:00
parent 8de28852cd
commit b72e3943a4
Signed by: eduard
GPG key ID: 49226B848C78F6C8
3 changed files with 10 additions and 15 deletions

View file

@ -7,7 +7,6 @@ import (
"git.akyoto.dev/cli/q/src/compiler"
"git.akyoto.dev/cli/q/src/elf"
"git.akyoto.dev/cli/q/src/errors"
)
// Build describes a compiler build.
@ -26,16 +25,6 @@ func New(directory string) *Build {
// Run parses the input files and generates an executable file.
func (build *Build) Run() error {
stat, err := os.Stat(build.Directory)
if err != nil {
return err
}
if !stat.IsDir() {
return &errors.InvalidDirectory{Path: build.Directory}
}
functions, err := compiler.Compile(build.Directory)
if err != nil {