adapted and enhanced the dict operations to make them compatible with the new DictType
This commit is contained in:
+2
-2
@@ -59,11 +59,11 @@ func evalDot(ctx ExprContext, self *term) (v any, err error) {
|
||||
if index, err = verifyIndex(ctx, indexTerm, len(unboxedValue)); err == nil {
|
||||
v = string(unboxedValue[index])
|
||||
}
|
||||
case map[any]any:
|
||||
case *DictType:
|
||||
var ok bool
|
||||
var indexValue any
|
||||
if indexValue, err = indexTerm.compute(ctx); err == nil {
|
||||
if v, ok = unboxedValue[indexValue]; !ok {
|
||||
if v, ok = (*unboxedValue)[indexValue]; !ok {
|
||||
err = fmt.Errorf("key %v does not belong to the dictionary", rightValue)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user