From e9bbcea81d90890a04155d81300b59a71a47472d Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 13 Aug 2014 12:53:50 -0700 Subject: [PATCH] text/scanner: improve documentation LGTM=r R=r CC=golang-codereviews https://golang.org/cl/123390043 --- src/pkg/text/scanner/scanner.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.48.1