mirror of https://github.com/golang/go.git
The zero value of token.Pos is special: it determines IsValid(), which has semantic significance in many places. offsetPositions, which adjusts positions after AST mangling, was adjusting all positions -- including invalid positions. As a result it was making invalid positions valid, leaving a nonsensical AST. Fix it to skip invalid positions. Change-Id: I844f243f9a4a3f98ace32fe30e934410d11142dd Reviewed-on: https://go-review.googlesource.com/c/tools/+/361614 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> |
||
|---|---|---|
| .. | ||
| analysisinternal | ||
| apidiff | ||
| event | ||
| fakenet | ||
| fastwalk | ||
| gocommand | ||
| gopathwalk | ||
| imports | ||
| jsonrpc2 | ||
| jsonrpc2_v2 | ||
| lsp | ||
| memoize | ||
| mod | ||
| packagesinternal | ||
| proxydir | ||
| span | ||
| stack | ||
| testenv | ||
| tool | ||
| typeparams | ||
| typesinternal | ||
| xcontext | ||