From: Robert Griesemer Date: Wed, 13 Aug 2014 19:53:50 +0000 (-0700) Subject: text/scanner: improve documentation X-Git-Tag: go1.4beta1~828 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e9bbcea81d90890a04155d81300b59a71a47472d;p=gostls13.git text/scanner: improve documentation LGTM=r R=r CC=golang-codereviews https://golang.org/cl/123390043 --- diff --git a/src/pkg/text/scanner/scanner.go b/src/pkg/text/scanner/scanner.go index 25b2c9e02a..5199ee4fc7 100644 --- a/src/pkg/text/scanner/scanner.go +++ b/src/pkg/text/scanner/scanner.go @@ -66,6 +66,12 @@ func (pos Position) String() string { // // ScanIdents | ScanInts | SkipComments // +// With the exceptions of comments, which are skipped if SkipComments is +// set, unrecognized tokens are not ignored. Instead, the scanner simply +// returns the respective individual characters (or possibly sub-tokens). +// For instance, if the mode is ScanIdents (not ScanStrings), the string +// "foo" is scanned as the token sequence '"' Ident '"'. +// const ( ScanIdents = 1 << -Ident ScanInts = 1 << -Int