// scanEOL consumes the current CR or LF.
// In case of CR, also consumes an optionally following LF.
scanEOL consumes the current CR or LF.
In case of CR, also consumes an optionally following LF.
// scanEOL consumes the current CR or LF . // In case of CR also consumes an optionally following LF .
func (s *Scanner) scanEOL() (tok Token, lit string) {
	var buf bytes.Buffer
	ch := s.read()
	if ch == eof {
		s.unread()
		return EOL, buf.String()
	}
	buf.WriteRune(ch)
	if ch == lf {
		return EOL, buf.String()
	}
	ch = s.read()
	if ch == lf {
		buf.WriteRune(ch)
	} else {
		s.unread()
	}
	return EOL, buf.String()
}
func ( s * Scanner ) scanEOL ( ) ( tok Token , lit string ) { var buf bytes . Buffer ch := s . read ( ) if ch == eof { s . unread ( ) return EOL , buf . String ( ) } buf . WriteRune ( ch ) if ch == lf { return EOL , buf . String ( ) } ch = s . read ( ) if ch == lf { buf . WriteRune ( ch ) } else { s . unread ( ) } return EOL , buf . String ( ) }
scanEOL consumes the current CR or LF.
scanEOL consumes the current CR or LF .
// Create a buffer and read the current character into it. // break at LF // optionally, consume an LF after CR