moved the exportVar() and exportFunc() functions from data-cursor.go to context-helpers.go
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user