From 019470faf1cc59a8ebdbc1d79e0b92b832a66342 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Wed, 19 Jun 2024 09:20:02 +0200 Subject: [PATCH] operator-range.go: Fixed priority bug; when range only has the left limit, right limit is set to ConstLastIndex constant --- operator-range.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operator-range.go b/operator-range.go index 8b485de..14ee694 100644 --- a/operator-range.go +++ b/operator-range.go @@ -29,7 +29,7 @@ func newRangeTerm(tk *Token) (inst *term) { tk: *tk, children: make([]*term, 0, 2), position: posInfix, - priority: priDot, + priority: priRange, evalFunc: evalRange, } } @@ -47,7 +47,7 @@ func evalRange(ctx ExprContext, self *term) (v any, err error) { if leftValue, err = self.children[0].compute(ctx); err != nil { return } - rightValue = int64(-1) + rightValue = int64(ConstLastIndex) } else if leftValue, rightValue, err = self.evalInfix(ctx); err != nil { return }