You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request.
At the moment there's no way to obtain the raw source position from a token.Pos, that is
a position that is not modified by potential //line comments.
This leads to problems when formatting source code (gofmt, godoc) because in that case
we care about the actual source positions, not "virtual" positions. gofmt has
a work-around at the moment, and godoc does have one once issue #5247 is fixed.
See issue #5247 for more details and possible token.Pos solutions.
The text was updated successfully, but these errors were encountered:
Package addition.
PositionFor permits access to both, positions
adjusted by //line comments (like the Position
accessors), and unadjusted "raw" positions
unaffected by //line comments.
Raw positions are required for correct formatting
of source code via go/printer which until now had
to manually fix adjusted positions.
Fixesgolang#7702.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135110044
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 9, 2018
Package addition.
PositionFor permits access to both, positions
adjusted by //line comments (like the Position
accessors), and unadjusted "raw" positions
unaffected by //line comments.
Raw positions are required for correct formatting
of source code via go/printer which until now had
to manually fix adjusted positions.
Fixesgolang#7702.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135110044
The text was updated successfully, but these errors were encountered: