new operator 'in' added. It check if an item is member of a list, or if a key is contained in a dictionary
This commit is contained in:
@@ -6,6 +6,7 @@ package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -61,6 +62,16 @@ func newList(listAny []any) (list *ListType) {
|
||||
return
|
||||
}
|
||||
|
||||
func (list *ListType) indexDeepCmp(target any) (index int) {
|
||||
index = -1
|
||||
for i, item := range *list {
|
||||
if reflect.DeepEqual(item, target) {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// -------- list term
|
||||
func newListTermA(args ...*term) *term {
|
||||
|
||||
Reference in New Issue
Block a user