merged with datasource-context
This commit is contained in:
+14
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user