Simplified ast package

This commit is contained in:
Eduard Urbach 2025-02-20 14:12:25 +01:00
parent d26bf9d1a9
commit 35ee40988d
Signed by: eduard
GPG key ID: 49226B848C78F6C8
19 changed files with 151 additions and 168 deletions

View file

@ -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)
}