code: func (r *reader) read() (ch rune, pos Pos) {
  	// If we have unread characters then read them off the buffer first.
  	if r.n > 0 {
  		r.n--
  		return r.curr()
  	}
  
  	// Read next rune from underlying reader.
  	// Any error (including io.EOF) should return as EOF.
  	ch, _, err := r.r.ReadRune()
  	if err != nil {
  		ch = eof
  	} else if ch == '\r' {
  		if ch, _, err := r.r.ReadRune(); err != nil {
  			// nop
  		} else if ch != '\n' {
  			_ = r.r.UnreadRune()
  		}
  		ch = '\n'
  	}
  
  	// Save character and position to the buffer.
  	r.i = (r.i + 1) % len(r.buf)
  	buf := &r.buf[r.i]
  	buf.ch, buf.pos = ch, r.pos
  
  	// Update position.
  	// Only count EOF once.
  	if ch == '\n' {
  		r.pos.Line++
  		r.pos.Char = 0
  	} else if !r.eof {
  		r.pos.Char++
  	}
  
  	// Mark the reader as EOF.
  	// This is used so we don't double count EOF characters.
  	if ch == eof {
  		r.eof = true
  	}
  
  	return r.curr()
  }
docs: // read reads the next rune from the reader.