list iterators now support start, stop e step
This commit is contained in:
+6
-1
@@ -30,7 +30,12 @@ func evalLength(ctx ExprContext, self *term) (v any, err error) {
|
||||
s, _ := childValue.(string)
|
||||
v = int64(len(s))
|
||||
} else if it, ok := childValue.(Iterator); ok {
|
||||
v = int64(it.Index() + 1)
|
||||
if extIt, ok := childValue.(ExtIterator); ok && extIt.HasOperation(countName) {
|
||||
count, _ := extIt.CallOperation(countName, nil)
|
||||
v, _ = toInt(count, "")
|
||||
} else {
|
||||
v = int64(it.Index() + 1)
|
||||
}
|
||||
} else {
|
||||
err = self.errIncompatibleType(childValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user