Added scope package

This commit is contained in:
Eduard Urbach 2024-07-20 23:20:23 +02:00
parent fd66296826
commit 8e725da9c6
Signed by: eduard
GPG key ID: 49226B848C78F6C8
37 changed files with 416 additions and 371 deletions

View file

@ -0,0 +1,19 @@
package core
import (
"git.akyoto.dev/cli/q/src/build/ast"
"git.akyoto.dev/cli/q/src/build/errors"
"git.akyoto.dev/cli/q/src/build/token"
)
// CompileTokens compiles a token list.
func (f *Function) CompileTokens(tokens token.List) error {
body, err := ast.Parse(tokens)
if err != nil {
err.(*errors.Error).File = f.File
return err
}
return f.CompileAST(body)
}