]> Cypherpunks repositories - gostls13.git/commit
go/token: implement PositionFor accessors
authorRobert Griesemer <gri@golang.org>
Thu, 28 Aug 2014 19:16:06 +0000 (12:16 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 28 Aug 2014 19:16:06 +0000 (12:16 -0700)
commite66ff2b9080669373704914191abf2ee5f65eb75
treefd1262710c695a369d32183397c43dff400f4e76
parentb155e79f23d66d70f761d73cb7478c5fb59c915c
go/token: implement PositionFor accessors

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.

Fixes #7702.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135110044
src/pkg/go/token/position.go
src/pkg/go/token/position_test.go