promql/parser: use pos instead of origin. (#7853)

Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
johncming 2020-08-26 17:56:26 +08:00 committed by GitHub
parent bb5c6b38e2
commit 267dd17fe7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ func (e *ParseErr) Error() string {
positionStr = "invalid position:" positionStr = "invalid position:"
} else { } else {
for i, c := range e.Query[:e.PositionRange.Start] { for i, c := range e.Query[:pos] {
if c == '\n' { if c == '\n' {
lastLineBreak = i lastLineBreak = i
line++ line++