Documentation
¶
Index ¶
- Constants
- type Lexer
- func (l Lexer) Current() string
- func (l *Lexer) Emit(t TokenType)
- func (l *Lexer) Error(e string)
- func (l *Lexer) Ignore()
- func (l *Lexer) Next() rune
- func (l *Lexer) NextToken() (*Token, bool)
- func (l *Lexer) Peek() rune
- func (l *Lexer) Rewind()
- func (l *Lexer) SetBufferSize(s int)
- func (l *Lexer) Start()
- func (l *Lexer) Take(chars string)
- type StateFunc
- func DateTimeState(l *Lexer) StateFunc
- func IdleState(l *Lexer) StateFunc
- func MetaKeyState(l *Lexer) StateFunc
- func MetaValueState(l *Lexer) StateFunc
- func MovementState(l *Lexer) StateFunc
- func NoteState(l *Lexer) StateFunc
- func NumberState(l *Lexer) StateFunc
- func ValueState(l *Lexer) StateFunc
- func WhitespaceState(l *Lexer) StateFunc
- type Token
- type TokenType
Constants ¶
View Source
const EOFRune rune = -1
EOFRune is the end of file rune.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer struct {
Err error
ErrorHandler func(e string)
// contains filtered or unexported fields
}
Lexer is the core struct that manages state through the StateFuncs.
func (*Lexer) Error ¶
Error provides a mechanism for parsers to signal to the Lexer an error has occurred.
func (*Lexer) Ignore ¶
func (l *Lexer) Ignore()
Ignore dumps the VCR and sets the current beginning position to the cursor.
func (*Lexer) Rewind ¶
func (l *Lexer) Rewind()
Rewind pops the last rune from the VCR and sets position there guarding against rewinding into a previous token.
func (*Lexer) SetBufferSize ¶
SetBufferSize is a setter for the buffer capacity.
type StateFunc ¶
StateFunc takes in a pointer to Lexer and returns a new StateFunc.
func DateTimeState ¶
func MetaKeyState ¶
func MetaValueState ¶
func MovementState ¶
func NumberState ¶
func ValueState ¶
TODO: Probe for movements starting with a number as well as a load like "bw"
func WhitespaceState ¶
Click to show internal directories.
Click to hide internal directories.