diff options
author | Russ Cox <rsc@golang.org> | 2010-04-21 16:40:53 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-04-21 16:40:53 -0700 |
commit | b5c7ab099f6f6712a4f95da09d71d0ab378f6431 (patch) | |
tree | 658ed98c6804a2d8e11b7ea023ac07d7820299ae /src/pkg/json/scanner.go | |
parent | 857111428bbbeef6a845399f49c9f113db6bbfde (diff) | |
download | golang-b5c7ab099f6f6712a4f95da09d71d0ab378f6431.tar.gz |
json: Marshal, Unmarshal using new scanner
R=r
CC=golang-dev
http://codereview.appspot.com/953041
Diffstat (limited to 'src/pkg/json/scanner.go')
-rw-r--r-- | src/pkg/json/scanner.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pkg/json/scanner.go b/src/pkg/json/scanner.go index c622bc679..c1934c8d9 100644 --- a/src/pkg/json/scanner.go +++ b/src/pkg/json/scanner.go @@ -181,6 +181,10 @@ func (s *scanner) popParseState() { } } +func isSpace(c int) bool { + return c == ' ' || c == '\t' || c == '\r' || c == '\n' +} + // NOTE(rsc): The various instances of // // if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') @@ -590,7 +594,7 @@ func stateError(s *scanner, c int) int { // error records an error and switches to the error state. func (s *scanner) error(c int, context string) int { s.step = stateError - s.err = SyntaxError("invalid character '" + quoteChar(c) + "' " + context) + s.err = SyntaxError("invalid character " + quoteChar(c) + " " + context) return scanError } |