Documentation
¶
Overview ¶
Package lexer provides basic helpers to implement parsers
Index ¶
Constants ¶
View Source
const ( // ReadBufferSize indicates the initial buffer size ReadBufferSize = 1 << 7 // 128B // DoublingBufferSizeLimit indicates when we stop doubling // and just add instead DoublingBufferSizeLimit = 1 << 17 // 128KiB )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Error ¶ added in v0.3.3
Error represents a generic parsing error
type Reader ¶ added in v0.3.1
type Reader struct {
// contains filtered or unexported fields
}
Reader is a RuneReader aimed at implementing text parsers
func NewReaderBytes ¶ added in v0.3.1
NewReaderBytes creates a new runes Reader using the given bytes
func NewReaderString ¶ added in v0.3.1
NewReaderString creates a new runes Reader using the given string
func (*Reader) Discard ¶ added in v0.3.1
func (b *Reader) Discard()
Discard removes from the buffer everything that has been Read
func (*Reader) Emit ¶ added in v0.3.1
Emit returns what's already being Read and discards it afterwards
func (*Reader) PeekRune ¶ added in v0.3.1
PeekRune returns information about the next rune without moving the cursor
func (*Reader) ReadRune ¶ added in v0.3.1
ReadRune reads the next rune
func (*Reader) String ¶ added in v0.3.1
String returns what's already Read but not yet emitted or discarded
Click to show internal directories.
Click to hide internal directories.