Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(175)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 161061: code review 161061: Handle \r as a whitespace when parsing JSON string.

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 1 month ago by skibaa
Modified:
2 years, 2 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.
Handle \r as a whitespace when parsing JSON string. Fixes issue 272.

Patch Set 1 #

Patch Set 2 : code review 161061: Handle \r as a whitespace when parsing JSON string. #

Created: 16 years, 1 month ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -1 line) Patch
M src/pkg/json/parse.go View 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/json/struct_test.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
Total messages: 5
|
skibaa
Hello rsc, I'd like you to review the following change.
16 years, 1 month ago (2009年11月26日 18:26:46 UTC) #1
Hello rsc,
I'd like you to review the following change.
Sign in to reply to this message.
rsc
thanks. could you please fill out the CLA as described at http://golang.org/doc/contribute.html#copyright and let me ...
16 years, 1 month ago (2009年11月29日 23:27:14 UTC) #2
thanks.
could you please fill out the CLA as described at
http://golang.org/doc/contribute.html#copyright and
let me know once you have?
there is no need to send a separate AUTHORS/CONTRIBUTORS
CL - we'll take care of that - just let me know when you've
completed the appropriate contributor agreement.
thanks.
russ
On Thu, Nov 26, 2009 at 10:26, <skibaa@gmail.com> wrote:
> Reviewers: rsc,
>
> Message:
> Hello rsc,
>
> I'd like you to review the following change.
>
>
> Description:
> Handle \r as a whitespace when parsing JSON string.
> Fixes issue 272.
>
> Please review this at http://codereview.appspot.com/161061
>
> Affected files:
> M src/pkg/json/parse.go
> M src/pkg/json/struct_test.go
>
>
> Index: src/pkg/json/parse.go
> ===================================================================
> --- a/src/pkg/json/parse.go
> +++ b/src/pkg/json/parse.go
> @@ -198,7 +198,7 @@
>    return c == '"' || c == '[' || c == ']' || c == ':' || c == '{' || c
> == '}' || c == ','
> }
>
> -func white(c byte) bool    { return c == ' ' || c == '\t' || c == '\n'
> || c == '\v' }
> +func white(c byte) bool    { return c == ' ' || c == '\t' || c == '\r'
> || c == '\n' || c == '\v' }
>
> func skipwhite(p string, i int) int {
>    for i < len(p) && white(p[i]) {
> Index: src/pkg/json/struct_test.go
> ===================================================================
> --- a/src/pkg/json/struct_test.go
> +++ b/src/pkg/json/struct_test.go
> @@ -66,6 +66,17 @@
>    }
> }
>
> +const whiteSpaceEncoded = " \t{\n\"s\"\r:\"string\"\v}"
> +
> +func TestUnmarshalWhitespace(t *testing.T) {
> +    var m myStruct;
> +    ok, errtok := Unmarshal(whiteSpaceEncoded, &m);
> +    if !ok {
> +        t.Fatalf("Unmarshal failed near %s", errtok)
> +    }
> +    check(t, m.S == "string", "string", m.S);
> +}
> +
> func TestUnmarshal(t *testing.T) {
>    var m myStruct;
>    m.F = true;
>
>
>
Sign in to reply to this message.
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=f7ba88b06ce9 *** Handle \r as a whitespace when parsing JSON string. Fixes ...
16 years, 1 month ago (2009年11月30日 20:03:30 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=f7ba88b06ce9 ***
Handle \r as a whitespace when parsing JSON string.
Fixes issue 272.
R=rsc
http://codereview.appspot.com/161061
Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.
rsc
16 years, 1 month ago (2009年12月02日 09:06:31 UTC) #4
Sign in to reply to this message.
rsc
16 years, 1 month ago (2009年12月02日 09:53:05 UTC) #5
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /