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

Issue 4634074: code review 4634074: fmt: Added SkipSpace() function to fmt's ScanState inte... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by mtj
Modified:
13 years, 10 months ago
Reviewers:
CC:
r2, r, gri1, mtj1, golang-dev
Visibility:
Public.

Description

fmt: Added SkipSpace() function to fmt's ScanState interface. Users of the Scan() infrastructure that employ ReadRune() rather than Token() need a way to skip leading spaces and newlines as set by the the parent, Fscan(), Fscanln, or Fscanf(). As the internal methods and boolean flags are not exported, this new function was added here and in the Int and Nat Scan() functions of the big package. (fmt.Rat did not need change since it uses Token()) Also added Printf style format code support to int types and tests for same to int_test.go

Patch Set 1 #

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

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

Total comments: 6

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -5 lines) Patch
M src/pkg/big/int.go View 1 2 3 4 5 3 chunks +54 lines, -4 lines 0 comments Download
M src/pkg/big/int_test.go View 1 2 3 4 5 2 chunks +30 lines, -1 line 0 comments Download
M src/pkg/fmt/scan.go View 1 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 16
mtj
Hello r@google.com (cc: golang-dev@googlegroups.com, gri@google.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-06-23 15:17:02 UTC) #1
r
LGTM for fmt changes. leaving for gri to review the other piece.
13 years, 11 months ago (2011-06-24 22:44:40 UTC) #2
gri1
Looks good, but the printing code needs test cases. - gri http://codereview.appspot.com/4634074/diff/6001/src/pkg/big/int.go File src/pkg/big/int.go (right): ...
13 years, 11 months ago (2011-06-24 23:00:56 UTC) #3
mtj1
Great. The FMT piece is all I intended from you as I wanted to get ...
13 years, 11 months ago (2011-06-24 23:03:33 UTC) #4
mtj1
I made test cases for all of these in int_test.go On Fri, Jun 24, 2011 ...
13 years, 11 months ago (2011-06-24 23:13:55 UTC) #5
mtj1
to wit: {"1234", "%d", "1234"}, {"1234", "%3d", "1234"}, {"1234", "%4d", "1234"}, {"-1234", "%d", "-1234"}, {"1234", ...
13 years, 11 months ago (2011-06-24 23:15:06 UTC) #6
mtj1
OK, will do, but the switch version will either depend on ordered evaluation or repeat ...
13 years, 11 months ago (2011-06-24 23:17:17 UTC) #7
r2
the ordering is the law, and it's wonderful. -rob
13 years, 11 months ago (2011-06-24 23:18:24 UTC) #8
gri1
Please add int_test.go to this CL (hg change <CL number>, add the file), and them ...
13 years, 11 months ago (2011-06-24 23:21:45 UTC) #9
mtj1
all done as suggested, builds and tests without error http://codereview.appspot.com/4634074/diff/6001/src/pkg/big/int.go File src/pkg/big/int.go (right): http://codereview.appspot.com/4634074/diff/6001/src/pkg/big/int.go#newcode362 src/pkg/big/int.go:362: ...
13 years, 11 months ago (2011-06-24 23:28:15 UTC) #10
r2
hg clpatch 4634074 edit ....
13 years, 11 months ago (2011-06-24 23:40:45 UTC) #11
mtj
Hello r@google.com, r@golang.org, gri@google.com, mtj@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-25 00:10:12 UTC) #12
mtj
Hello r@google.com, r@golang.org, gri@google.com, mtj@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-25 00:13:10 UTC) #13
mtj
Hello r@google.com, r@golang.org, gri@google.com, mtj@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-25 00:19:35 UTC) #14
gri1
LGTM thanks! - gri On Fri, Jun 24, 2011 at 5:19 PM, <michael.jones@gmail.com> wrote: > ...
13 years, 11 months ago (2011-06-25 00:25:09 UTC) #15
gri
13 years, 11 months ago (2011-06-25 00:26:48 UTC) #16
*** Submitted as http://code.google.com/p/go/source/detail?r=34ec6987d751 ***

fmt: Added SkipSpace() function to fmt's ScanState interface.

Users of the Scan() infrastructure that employ ReadRune() rather than
Token() need a way to skip leading spaces and newlines as set by the
the parent, Fscan(), Fscanln, or Fscanf(). As the internal methods and
boolean flags are not exported, this new function was added here and
in the Int and Nat Scan() functions of the big package. (fmt.Rat did
not need change since it uses Token()) Also added Printf style format
code support to int types and tests for same to int_test.go

R=r, r, gri, mtj
CC=golang-dev
http://codereview.appspot.com/4634074

Committer: Robert Griesemer <gri@golang.org>
Sign in to reply to this message.

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