lang: funcs: vars: Include system package variables in the scope

This commit is contained in:
James Shubin
2024-08-07 17:29:50 -04:00
parent a93c98402a
commit 8e9c3b6c1e
2 changed files with 12 additions and 4 deletions

View File

@@ -3433,10 +3433,13 @@ func (obj *StmtProg) importSystemScope(name string) (*interfaces.Scope, error) {
// TODO: do we want to run Interpolate or SetScope?
}
// TODO: pass `data` into ast.VarPrefixToVariablesScope ?
variables := VarPrefixToVariablesScope(name) // strips prefix!
// initial scope, built from core golang code
scope := &interfaces.Scope{
// TODO: we could use the core API for variables somehow...
//Variables: make(map[string]interfaces.Expr),
Variables: variables,
Functions: functions, // map[string]interfaces.Expr
// TODO: we could add a core API for classes too!
//Classes: make(map[string]interfaces.Stmt),