1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:21:22 -06:00
go/src/pkg/scanner
Robert Griesemer eaae95fa3d scanner: fix Position returned by Scan, Pos
The implementation of the position computation
was surprisingly broken. Implemented fixes and
added extra test cases.

There is a slight interface change: Calling
Pos() returns the current position; but if
called before Scan() that position may not
be the position of the next token returned
by Scan() (depending on the scan settings
and the source text) - this in contrast to
the original comment.

However, after calling Scan(), the Scanner's
Position field reports the position of the
scanned token, as before.

Fixes #1327.

R=rsc
CC=golang-dev
https://golang.org/cl/3972047
2011-01-25 13:32:56 -08:00
..
Makefile build: no required environment variables 2010-08-18 10:08:49 -04:00
scanner_test.go scanner: fix Position returned by Scan, Pos 2011-01-25 13:32:56 -08:00
scanner.go scanner: fix Position returned by Scan, Pos 2011-01-25 13:32:56 -08:00