Updates #74958
Change-Id: I43dcbff6ec828bddf157b2e6ec80df526a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738700
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
for {
pos, tok, lit := s.Scan()
+ end := s.End()
+
switch tok {
case token.EOF:
return errors
fallthrough
default:
prev = pos
- var l int // token length
- if tok.IsLiteral() {
- l = len(lit)
- } else {
- l = len(tok.String())
- }
- here = prev + token.Pos(l)
+ here = end
}
}
}