Simplified ast package

This commit is contained in:
2025-02-20 14:12:25 +01:00
parent 45a36a645a
commit b655950516
19 changed files with 151 additions and 168 deletions

@ -2,18 +2,16 @@ package core
import (
"git.akyoto.dev/cli/q/src/ast"
"git.akyoto.dev/cli/q/src/errors"
"git.akyoto.dev/cli/q/src/token"
)
// CompileTokens compiles a token list.
func (f *Function) CompileTokens(tokens []token.Token) error {
body, err := ast.Parse(tokens, f.File.Bytes)
tree, err := ast.Parse(tokens, f.File)
if err != nil {
err.(*errors.Error).File = f.File
return err
}
return f.CompileAST(body)
return f.CompileAST(tree)
}