Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
88a9e76e
Commit
88a9e76e
authored
Feb 09, 2012
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text/scanner: update comments
Fixes #2962. R=rsc CC=golang-dev
https://golang.org/cl/5652048
parent
9cd4a046
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
scanner.go
src/pkg/text/scanner/scanner.go
+3
-4
No files found.
src/pkg/text/scanner/scanner.go
View file @
88a9e76e
...
...
@@ -5,8 +5,7 @@
// 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
// through repeated calls to the Scan function. For compatibility with
// existing tools, the NUL character is not allowed (implementation
// restriction).
// existing tools, the NUL character is not allowed.
//
// By default, a Scanner skips white space and Go comments and recognizes all
// literals as defined by the Go language specification. It may be
...
...
@@ -104,7 +103,7 @@ var tokenString = map[rune]string{
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
{
if
s
,
found
:=
tokenString
[
tok
];
found
{
return
s
...
...
@@ -287,7 +286,7 @@ func (s *Scanner) next() rune {
// special situations
switch
ch
{
case
0
:
//
implementation restriction
for compatibility with other tools
// for compatibility with other tools
s
.
error
(
"illegal character NUL"
)
case
'\n'
:
s
.
line
++
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment