refactored data-types to reduce plugin sizes
This commit is contained in:
+7
-5
@@ -7,6 +7,8 @@ package expr
|
||||
import (
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/scan"
|
||||
"git.portale-stac.it/go-pkg/expr/types/array"
|
||||
"git.portale-stac.it/go-pkg/expr/types/dict"
|
||||
)
|
||||
|
||||
//-------- in term
|
||||
@@ -33,11 +35,11 @@ func evalIn(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if kern.IsList(rightValue) {
|
||||
list, _ := rightValue.(*kern.ListType)
|
||||
v = list.IndexDeepSameCmp(leftValue) >= 0
|
||||
} else if kern.IsDict(rightValue) {
|
||||
dict, _ := rightValue.(*kern.DictType)
|
||||
if array.IsList(rightValue) {
|
||||
a, _ := rightValue.(*array.ListType)
|
||||
v = a.IndexDeepSameCmp(leftValue) >= 0
|
||||
} else if dict.IsDict(rightValue) {
|
||||
dict, _ := rightValue.(*dict.DictType)
|
||||
v = dict.HasKey(leftValue)
|
||||
} else {
|
||||
err = opTerm.ErrIncompatibleTypes(leftValue, rightValue)
|
||||
|
||||
Reference in New Issue
Block a user