Documentation
¶
Overview ¶
reader normalizes OS newlines and returns EOF for end of line and panics for errors, which simplifies its usage it also keeps track of the position of the cursor in terms of bytes, lines and columns.
Index ¶
Constants ¶
View Source
const EOF rune = 3 // Pretend there's an EOF byte at the end of the file to simplify control flow, it's treated like a newline TODO: might be better to use -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { Line int // The line number (start with 0) LineRuneOffset int // The number of runes read on this line LineOffset int // The number of bytes read on this line ByteOffset int // The number of bytes read so far File string // The file path if present // contains filtered or unexported fields }
type Reader ¶
func New ¶
func New(readSeeker io.ReadSeeker) *Reader
func (*Reader) UnreadRune ¶
func (r *Reader) UnreadRune()
Click to show internal directories.
Click to hide internal directories.