Control vars are now stored in the globalCtx only.

However, it is still allowed to store control var in a local context in special situation
This commit is contained in:
2024-06-07 14:39:17 +02:00
parent 115ce26ce9
commit f347b15146
7 changed files with 74 additions and 65 deletions
+2 -1
View File
@@ -34,7 +34,8 @@ func evalContextValue(ctx ExprContext, self *term) (v any, err error) {
if formatter, ok := sourceCtx.(Formatter); ok {
v = formatter.ToString(0)
} else {
keys := sourceCtx.EnumVars(func(name string) bool { return name[0] != '_' })
// keys := sourceCtx.EnumVars(func(name string) bool { return name[0] != '_' })
keys := sourceCtx.EnumVars(nil)
d := make(map[string]any)
for _, key := range keys {
d[key], _ = sourceCtx.GetVar(key)