operand-iterator.go: adapted to the new DictType

This commit is contained in:
Celestino Amoroso 2024-05-19 01:47:06 +02:00
parent 9ea170e53b
commit 6c14c07d66

View File

@ -66,12 +66,13 @@ func evalFirstChild(ctx ExprContext, self *term) (value any, err error) {
} }
func getDataSourceDict(ctx ExprContext, self *term, firstChildValue any) (ds map[string]Functor, err error) { func getDataSourceDict(ctx ExprContext, self *term, firstChildValue any) (ds map[string]Functor, err error) {
if dictAny, ok := firstChildValue.(map[any]any); ok { // if dictAny, ok := firstChildValue.(map[any]any); ok {
if dictAny, ok := firstChildValue.(*DictType); ok {
requiredFields := []string{currentName, nextName} requiredFields := []string{currentName, nextName}
fieldsMask := 0b11 fieldsMask := 0b11
foundFields := 0 foundFields := 0
ds = make(map[string]Functor) ds = make(map[string]Functor)
for keyAny, item := range dictAny { for keyAny, item := range *dictAny {
if key, ok := keyAny.(string); ok { if key, ok := keyAny.(string); ok {
if functor, ok := item.(*funcDefFunctor); ok { if functor, ok := item.(*funcDefFunctor); ok {
ds[key] = functor ds[key] = functor