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

Issue 4248076: code review 4248076: fmt: heaven forfend we export EOF = -1 (Closed)

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

Description

fmt: heaven forfend we export EOF = -1

Patch Set 1 #

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -11 lines) Patch
M src/pkg/fmt/scan.go View 11 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 5
r
Hello adg (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years, 2 months ago (2011-03-10 00:47:20 UTC) #1
adg
LGTM and I learned a new word! ("forfend") On 10 March 2011 11:47, <r@golang.org> wrote: ...
14 years, 2 months ago (2011-03-10 00:51:58 UTC) #2
r
*** Submitted as http://code.google.com/p/go/source/detail?r=a3f18cf885c9 *** fmt: heaven forfend we export EOF = -1 R=adg CC=golang-dev ...
14 years, 2 months ago (2011-03-10 00:53:35 UTC) #3
rsc1
what about ScanState.GetRune? type ScanState interface { // GetRune reads the next rune (Unicode code ...
14 years, 2 months ago (2011-03-10 01:19:49 UTC) #4
r2
14 years, 2 months ago (2011-03-10 01:21:13 UTC) #5
On Mar 9, 2011, at 5:17 PM, Russ Cox wrote:

> what about ScanState.GetRune?
> 
> 
> type ScanState interface {
>    // GetRune reads the next rune (Unicode code point) from the input.
>    // If invoked during Scanln, Fscanln, or Sscanln, GetRune() will
>    // return EOF after returning the first '\n'.
>    GetRune() (rune int, err os.Error)
>    // UngetRune causes the next call to GetRune to return the same rune.
>    UngetRune()
>    // Width returns the value of the width option and whether it has been set.
>    // The unit is Unicode code points.
>    Width() (wid int, ok bool)
>    // Token returns the next space-delimited token from the input. If
>    // a width has been specified, the returned token will be no longer
>    // than the width.
>    Token() (token string, err os.Error)
> }
> ScanState represents the scanner state passed to custom scanners.
> Scanners may do rune-at-a-time scanning or ask the ScanState
> to discover the next space-delimited token.

it's been called ReadRune for quite a while, and EOF is an error, not the
returned rune.

-rob

Sign in to reply to this message.

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