]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: track line directives w/ column information
authorRobert Griesemer <gri@golang.org>
Fri, 23 Feb 2018 01:24:19 +0000 (17:24 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 26 Feb 2018 18:32:03 +0000 (18:32 +0000)
commit515fa58ac967c88376a56e0c5b76e86ce1658150
treef6403f85c607ba224f1a7cfc60d719d1c57283b2
parent6fa6bde92408a526021d690003f19368f5d57b20
cmd/compile: track line directives w/ column information

Extend cmd/internal/src.PosBase to track column information,
and adjust the meaning of the PosBase position to mean the
position at which the PosBase's relative (line, col) position
starts (rather than indicating the position of the //line
directive). Because this semantic change is made in the
compiler's noder, it doesn't affect the logic of src.PosBase,
only its test setup (where PosBases are constructed with
corrected incomming positions). In short, src.PosBase now
matches syntax.PosBase with respect to the semantics of
src.PosBase.pos.

For #22662.

Change-Id: I5b1451cb88fff3f149920c2eec08b6167955ce27
Reviewed-on: https://go-review.googlesource.com/96535
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/asm/internal/lex/input.go
src/cmd/compile/internal/gc/noder.go
src/cmd/internal/obj/line_test.go
src/cmd/internal/src/pos.go
src/cmd/internal/src/pos_test.go
src/cmd/internal/src/xpos_test.go
test/fixedbugs/issue22662.go [new file with mode: 0644]