Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Type ItemType // Type of the item. Line int // Line within the input (1-base) of the item. Pos int // Starting position within the input, in bytes, of the item. Val []byte // Value of the item. }
Item represents a lexed item, a lexeme.
type ItemType ¶
type ItemType int
ItemType identifies the type of the items.
const ( ItemError ItemType = iota // Error. Its value is the error message. ItemEOF // End of input. ItemHeader // '::', but only when starting a line. ItemName // Text w/ backslash escaped characters. ItemTags // '[tag1 tag2 tagN]'. ItemMetadata // JSON chunk, '{…}'. ItemContent // Plain text. )
Item type constants.
type Tweelexer ¶
type Tweelexer struct {
// contains filtered or unexported fields
}
Tweelexer holds the state of the scanner.
func NewTweelexer ¶
NewTweelexer creates a new scanner for the input text.
func (*Tweelexer) Drain ¶
func (l *Tweelexer) Drain()
Drain drains the item channel so the lexing goroutine will close the item channel and exit. Called by the parser, not tweelexer.
Click to show internal directories.
Click to hide internal directories.