linked-list: sum and in operators

This commit is contained in:
2026-07-13 14:27:18 +02:00
parent 4df222496d
commit daca05e637
5 changed files with 39 additions and 6 deletions
+4
View File
@@ -9,6 +9,7 @@ import (
"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"
"git.portale-stac.it/go-pkg/expr/types/list"
)
//-------- in term
@@ -41,6 +42,9 @@ func evalIn(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
} else if dict.IsDict(rightValue) {
dict, _ := rightValue.(*dict.DictType)
v = dict.HasKey(leftValue)
} else if list.IsLinkedList(rightValue) {
ls, _ := rightValue.(*list.LinkedList)
v = ls.HasValue(leftValue)
} else {
err = opTerm.ErrIncompatibleTypes(leftValue, rightValue)
}