util files moved form kern to util package
This commit is contained in:
+4
-3
@@ -9,6 +9,7 @@ import (
|
||||
"slices"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/util"
|
||||
// "strings"
|
||||
)
|
||||
|
||||
@@ -61,8 +62,8 @@ func (ctx *SimpleStore) GetGlobal() (globalCtx kern.ExprContext) {
|
||||
func (ctx *SimpleStore) Clone() kern.ExprContext {
|
||||
clone := &SimpleStore{
|
||||
global: ctx.global,
|
||||
varStore: kern.CloneFilteredMap(ctx.varStore, filterRefName),
|
||||
funcStore: kern.CloneFilteredMap(ctx.funcStore, filterRefName),
|
||||
varStore: util.CloneFilteredMap(ctx.varStore, filterRefName),
|
||||
funcStore: util.CloneFilteredMap(ctx.funcStore, filterRefName),
|
||||
}
|
||||
return clone
|
||||
}
|
||||
@@ -138,7 +139,7 @@ func (ctx *SimpleStore) UnsafeSetVar(varName string, value any) {
|
||||
|
||||
func (ctx *SimpleStore) SetVar(varName string, value any) {
|
||||
// fmt.Printf("[%p] SetVar(%v, %v)\n", ctx, varName, value)
|
||||
if allowedValue, ok := kern.FromGenericAny(value); ok {
|
||||
if allowedValue, ok := util.FromGenericAny(value); ok {
|
||||
ctx.varStore[varName] = allowedValue
|
||||
} else {
|
||||
panic(fmt.Errorf("unsupported type %T of value %v", value, value))
|
||||
|
||||
Reference in New Issue
Block a user