list iterators now support start, stop e step

This commit is contained in:
2024-05-04 08:07:49 +02:00
parent d9fbe6f36d
commit 2c5f02cc69
9 changed files with 115 additions and 37 deletions
+1 -10
View File
@@ -9,15 +9,6 @@ import (
"io"
)
const (
initName = "init"
cleanName = "clean"
resetName = "reset"
nextName = "next"
currentName = "current"
indexName = "index"
)
type dataCursor struct {
ds map[string]Functor
ctx ExprContext
@@ -77,7 +68,7 @@ func (dc *dataCursor) HasOperation(name string) (exists bool) {
func (dc *dataCursor) CallOperation(name string, args []any) (value any, err error) {
if name == indexName {
value = dc.Index()
value = int64(dc.Index())
} else if functor, ok := dc.ds[name]; ok && isFunctor(functor) {
if functor == dc.cleanFunc {
value, err = dc.Clean()