// scanWhitespace consumes the current rune and all contiguous whitespace.
scanWhitespace consumes the current rune and all contiguous whitespace.
// scanWhitespace consumes the current rune and all contiguous whitespace .
func (s *scanner) scanWhitespace() (tok token, lit string) {
	var buf bytes.Buffer
	buf.WriteRune(s.read())
	for {
		if ch := s.read(); ch == eof {
			break
		} else if !isWhitespace(ch) {
			s.unread()
			break
		} else {
			buf.WriteRune(ch)
		}
	}
	return tokWhitespace, buf.String()
}
func ( s * scanner ) scanWhitespace ( ) ( tok token , lit string ) { var buf bytes . Buffer buf . WriteRune ( s . read ( ) ) for { if ch := s . read ( ) ; ch == eof { break } else if ! isWhitespace ( ch ) { s . unread ( ) break } else { buf . WriteRune ( ch ) } } return tokWhitespace , buf . String ( ) }
scanWhitespace consumes the current rune and all contiguous whitespace.
scanWhitespace consumes the current rune and all contiguous whitespace .
// Create a buffer and read the current character into it. // Read every subsequent whitespace character into the buffer. // Non-whitespace characters and EOF will cause the loop to exit.