Added scope package

This commit is contained in:
2024-07-20 23:20:23 +02:00
parent 263c0cfb8b
commit 43cdac5572
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)
}