Lines Matching full:scanner
5 // Package scanner provides a scanner and tokenizer for UTF-8-encoded text.
11 // By default, a Scanner skips white space and Go comments and recognizes all
15 package scanner
53 // to configure a Scanner such that it only recognizes (Go) identifiers,
54 // integers, and skips comments, set the Scanner's Mode field to:
59 // set, unrecognized tokens are not ignored. Instead, the scanner simply
108 // GoWhitespace is the default value for the Scanner's Whitespace field.
114 // A Scanner implements reading of Unicode characters and tokens from an io.Reader.
115 type Scanner struct {
144 Error func(s *Scanner, msg string)
156 // set the ch'th bit in Whitespace (the Scanner's behavior is undefined
169 // The Filename field is always left untouched by the Scanner.
171 // the scanner is not inside a token. Call Pos to obtain an error
176 // Init initializes a Scanner with a new source and returns s.
179 func (s *Scanner) Init(src io.Reader) *Scanner {
216 func (s *Scanner) next() rune {
300 // update the Scanner's Position field; use Pos() to
302 func (s *Scanner) Next() rune {
313 // the scanner. It returns EOF if the scanner's position is at the last
315 func (s *Scanner) Peek() rune {
326 func (s *Scanner) error(msg string) {
339 func (s *Scanner) isIdentRune(ch rune, i int) bool {
346 func (s *Scanner) scanIdentifier() rune {
369 func (s *Scanner) scanMantissa(ch rune) rune {
376 func (s *Scanner) scanFraction(ch rune) rune {
383 func (s *Scanner) scanExponent(ch rune) rune {
394 func (s *Scanner) scanNumber(ch rune) (rune, rune) {
443 func (s *Scanner) scanDigits(ch rune, base, n int) rune {
454 func (s *Scanner) scanEscape(quote rune) rune {
474 func (s *Scanner) scanString(quote rune) (n int) {
491 func (s *Scanner) scanRawString() {
502 func (s *Scanner) scanChar() {
508 func (s *Scanner) scanComment(ch rune) rune {
538 // It returns EOF at the end of the source. It reports scanner errors (read and
541 func (s *Scanner) Scan() rune {
643 func (s *Scanner) Pos() (pos Position) {
665 func (s *Scanner) TokenText() string {