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
a1c92c61
Commit
a1c92c61
authored
May 25, 2011
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/scanner: use strconv.QuoteRune now that it is available
R=r, rsc CC=golang-dev
https://golang.org/cl/4538096
parent
8c207879
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
scanner.go
src/pkg/go/scanner/scanner.go
+1
-2
scanner_test.go
src/pkg/go/scanner/scanner_test.go
+3
-2
No files found.
src/pkg/go/scanner/scanner.go
View file @
a1c92c61
...
...
@@ -22,7 +22,6 @@ package scanner
import
(
"bytes"
"fmt"
"go/token"
"path/filepath"
"strconv"
...
...
@@ -671,7 +670,7 @@ scanAgain:
tok
=
S
.
switch3
(
token
.
OR
,
token
.
OR_ASSIGN
,
'|'
,
token
.
LOR
)
default
:
if
S
.
mode
&
AllowIllegalChars
==
0
{
S
.
error
(
offs
,
fmt
.
Sprintf
(
"illegal character '%c' (%U)"
,
ch
,
ch
))
S
.
error
(
offs
,
"illegal character "
+
strconv
.
QuoteRune
(
ch
))
}
insertSemi
=
S
.
insertSemi
// preserve insertSemi info
}
...
...
src/pkg/go/scanner/scanner_test.go
View file @
a1c92c61
...
...
@@ -650,8 +650,9 @@ var errors = []struct {
pos
int
err
string
}{
{
"
\a
"
,
token
.
ILLEGAL
,
0
,
"illegal character '
\a
' (U+0007)"
},
{
`#`
,
token
.
ILLEGAL
,
0
,
"illegal character '#' (U+0023)"
},
{
"
\a
"
,
token
.
ILLEGAL
,
0
,
"illegal character '
\\
a'"
},
{
`#`
,
token
.
ILLEGAL
,
0
,
"illegal character '#'"
},
{
`…`
,
token
.
ILLEGAL
,
0
,
"illegal character '
\\
u2026'"
},
{
`' '`
,
token
.
CHAR
,
0
,
""
},
{
`''`
,
token
.
CHAR
,
0
,
"illegal character literal"
},
{
`'\8'`
,
token
.
CHAR
,
2
,
"unknown escape sequence"
},
...
...
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