operator-range.go: Fixed priority bug; when range only has the left limit, right limit is set to ConstLastIndex constant
This commit is contained in:
parent
302430d57d
commit
019470faf1
@ -29,7 +29,7 @@ func newRangeTerm(tk *Token) (inst *term) {
|
|||||||
tk: *tk,
|
tk: *tk,
|
||||||
children: make([]*term, 0, 2),
|
children: make([]*term, 0, 2),
|
||||||
position: posInfix,
|
position: posInfix,
|
||||||
priority: priDot,
|
priority: priRange,
|
||||||
evalFunc: evalRange,
|
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 {
|
if leftValue, err = self.children[0].compute(ctx); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rightValue = int64(-1)
|
rightValue = int64(ConstLastIndex)
|
||||||
} else if leftValue, rightValue, err = self.evalInfix(ctx); err != nil {
|
} else if leftValue, rightValue, err = self.evalInfix(ctx); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user