Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1060)

Issue 4240056: code review 4240056: fmt: allow recursive calls to Fscan etc. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by rog
Modified:
14 years ago
Reviewers:
CC:
r, r2, golang-dev
Visibility:
Public.

Description

fmt: allow recursive calls to Fscan etc. Add a new Read method to ScanState so that it satisfies the io.Reader interface; rename Getrune and Ungetrune to ReadRune and UnreadRune. Make sure ReadRune does not read past width restrictions; remove now-unnecessary Width method from ScanState. Also make the documentation a little clearer as to how ReadRune and UnreadRune are used.

Patch Set 1 #

Patch Set 2 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 5 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 10 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 11 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Patch Set 12 : diff -r d9ff478c4ed3 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -108 lines) Patch
M src/pkg/fmt/doc.go View 1 2 3 4 1 chunk +9 lines, -7 lines 0 comments Download
M src/pkg/fmt/scan.go View 1 2 3 4 5 6 7 8 9 10 20 chunks +77 lines, -82 lines 0 comments Download
M src/pkg/fmt/scan_test.go View 1 2 3 4 5 6 7 8 7 chunks +32 lines, -19 lines 0 comments Download

Messages

Total messages: 13
rog
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-03-01 16:07:30 UTC) #1
r
i see why your tests aren't catching the bug: you have no tests i warn ...
14 years ago (2011-03-01 19:27:18 UTC) #2
rog
PTAL. i've removed the Width field as it now seems redundant; the Token method could ...
14 years ago (2011-03-02 14:23:29 UTC) #3
r2
On Mar 2, 2011, at 6:23 AM, rogpeppe@gmail.com wrote: > PTAL. > > i've removed ...
14 years ago (2011-03-02 18:07:43 UTC) #4
rog
On 2 March 2011 18:07, Rob 'Commander' Pike <r@google.com> wrote: > > On Mar 2, ...
14 years ago (2011-03-02 18:10:05 UTC) #5
r
i like how this is going but don't understand the deletion of Width http://codereview.appspot.com/4240056/diff/15001/src/pkg/fmt/scan.go File ...
14 years ago (2011-03-02 18:15:07 UTC) #6
r2
And the whole one-space/two-space thing is a minefield anyway. One space should be necessary but ...
14 years ago (2011-03-02 18:17:14 UTC) #7
rog
PTAL http://codereview.appspot.com/4240056/diff/15001/src/pkg/fmt/scan.go File src/pkg/fmt/scan.go (left): http://codereview.appspot.com/4240056/diff/15001/src/pkg/fmt/scan.go#oldcode39 src/pkg/fmt/scan.go:39: Width() (wid int, ok bool) On 2011/03/02 18:15:07, ...
14 years ago (2011-03-02 18:30:43 UTC) #8
r2
the scanner may care anyway and knowing in advance how wide the field is could ...
14 years ago (2011-03-02 18:34:42 UTC) #9
r
http://codereview.appspot.com/4240056/diff/16004/src/pkg/fmt/scan.go File src/pkg/fmt/scan.go (right): http://codereview.appspot.com/4240056/diff/16004/src/pkg/fmt/scan.go#newcode42 src/pkg/fmt/scan.go:42: // Because ReadRune is implemented by the interface, Read ...
14 years ago (2011-03-02 18:35:48 UTC) #10
rog
> the scanner may care anyway and knowing in advance how wide the field is ...
14 years ago (2011-03-02 18:50:13 UTC) #11
r
LGTM thanks, it's good
14 years ago (2011-03-02 18:52:09 UTC) #12
r
14 years ago (2011-03-02 18:54:32 UTC) #13
*** Submitted as http://code.google.com/p/go/source/detail?r=98d584670c65 ***

fmt: allow recursive calls to Fscan etc.
Add a new Read method to ScanState so that it
satisfies the io.Reader interface; rename
Getrune and Ungetrune to ReadRune and UnreadRune.
Make sure ReadRune does not read past width restrictions;
remove now-unnecessary Width method from ScanState.
Also make the documentation a little clearer as to
how ReadRune and UnreadRune are used.

R=r, r2
CC=golang-dev
http://codereview.appspot.com/4240056

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b