merged with datasource-context

This commit is contained in:
2024-04-27 06:19:12 +02:00
10 changed files with 106 additions and 95 deletions
+14 -1
View File
@@ -11,6 +11,20 @@ func cloneContext(sourceCtx ExprContext) (clonedCtx ExprContext) {
return
}
func exportVar(ctx ExprContext, name string, value any) {
if name[0] == '@' {
name = name[1:]
}
ctx.setVar(name, value)
}
func exportFunc(ctx ExprContext, name string, info ExprFunc) {
if name[0] == '@' {
name = name[1:]
}
ctx.RegisterFunc(name, info.Functor(), info.MinArgs(), info.MaxArgs())
}
func exportObjects(destCtx, sourceCtx ExprContext) {
exportAll := isEnabled(sourceCtx, control_export_all)
// Export variables
@@ -24,5 +38,4 @@ func exportObjects(destCtx, sourceCtx ExprContext) {
exportFunc(destCtx, refName, info)
}
}
}