]> Cypherpunks repositories - gostls13.git/commit
go/scanner: don't return token.INVALID for ".." sequence
authorRobert Griesemer <gri@golang.org>
Wed, 10 Oct 2018 21:13:49 +0000 (14:13 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 11 Oct 2018 20:26:55 +0000 (20:26 +0000)
commitf64fd66f24d5c19d26ac58c4027aa9398a935490
tree2bbfced3fedfb1348b80a5015bb2d75d170274da
parent7fb60eb1a2aaed7a801ab15bd7aaeaabdbb5e5db
go/scanner: don't return token.INVALID for ".." sequence

Per the spec, "...the next token is the longest sequence of characters
that form a valid token." Thus, encountering a ".." sequence should
return two token.PERIOD tokens rather than a single token.ILLEGAL.

Fixes #28112.

Change-Id: Iba5da841f40036e53f48f9be23f933f362e67f5e
Reviewed-on: https://go-review.googlesource.com/c/141337
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go