Commit 88a9e76e authored by Robert Griesemer's avatar Robert Griesemer

text/scanner: update comments

Fixes #2962.

R=rsc
CC=golang-dev
https://golang.org/cl/5652048
parent 9cd4a046
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
// Package scanner provides a scanner and tokenizer for UTF-8-encoded text. // Package scanner provides a scanner and tokenizer for UTF-8-encoded text.
// It takes an io.Reader providing the source, which then can be tokenized // It takes an io.Reader providing the source, which then can be tokenized
// through repeated calls to the Scan function. For compatibility with // through repeated calls to the Scan function. For compatibility with
// existing tools, the NUL character is not allowed (implementation // existing tools, the NUL character is not allowed.
// restriction).
// //
// By default, a Scanner skips white space and Go comments and recognizes all // By default, a Scanner skips white space and Go comments and recognizes all
// literals as defined by the Go language specification. It may be // literals as defined by the Go language specification. It may be
...@@ -104,7 +103,7 @@ var tokenString = map[rune]string{ ...@@ -104,7 +103,7 @@ var tokenString = map[rune]string{
Comment: "Comment", Comment: "Comment",
} }
// TokenString returns a (visible) string for a token or Unicode character. // TokenString returns a printable string for a token or Unicode character.
func TokenString(tok rune) string { func TokenString(tok rune) string {
if s, found := tokenString[tok]; found { if s, found := tokenString[tok]; found {
return s return s
...@@ -287,7 +286,7 @@ func (s *Scanner) next() rune { ...@@ -287,7 +286,7 @@ func (s *Scanner) next() rune {
// special situations // special situations
switch ch { switch ch {
case 0: case 0:
// implementation restriction for compatibility with other tools // for compatibility with other tools
s.error("illegal character NUL") s.error("illegal character NUL")
case '\n': case '\n':
s.line++ s.line++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment