expressions now support dict data-type

This commit is contained in:
2024-04-21 14:24:56 +02:00
parent b28d6a8f02
commit 323308d86f
9 changed files with 160 additions and 9 deletions
+9
View File
@@ -144,6 +144,15 @@ func (self *term) compute(ctx ExprContext) (v any, err error) {
return
}
func (self *term) toInt(computedValue any, valueDescription string) (i int, err error) {
if index64, ok := computedValue.(int64); ok {
i = int(index64)
} else {
err = self.Errorf("%s, got %T", valueDescription, computedValue)
}
return
}
func (self *term) errIncompatibleTypes(leftValue, rightValue any) error {
return self.tk.Errorf(
"left operand '%v' [%T] and right operand '%v' [%T] are not compatible with operator %q",