1
0
mirror of https://github.com/golang/go synced 2024-11-25 06:57:58 -07:00

go/scanner: fix build (adjust scanner EOF linecount)

R=adg
CC=golang-dev
https://golang.org/cl/3990045
This commit is contained in:
Robert Griesemer 2011-01-26 22:09:14 -08:00
parent 4497960b2d
commit 1e17621cbe

View File

@ -223,7 +223,7 @@ func TestScan(t *testing.T) {
for _, e := range tokens { for _, e := range tokens {
src += e.lit + whitespace src += e.lit + whitespace
} }
src_linecount := newlineCount(src) + 1 src_linecount := newlineCount(src)
whitespace_linecount := newlineCount(whitespace) whitespace_linecount := newlineCount(whitespace)
// verify scan // verify scan
@ -241,7 +241,7 @@ func TestScan(t *testing.T) {
if tok == token.EOF { if tok == token.EOF {
lit = "<EOF>" lit = "<EOF>"
epos.Line = src_linecount epos.Line = src_linecount
epos.Column = 1 epos.Column = 2
} }
checkPos(t, lit, pos, epos) checkPos(t, lit, pos, epos)
if tok != e.tok { if tok != e.tok {