Documentation
¶
Index ¶
Constants ¶
View Source
const (
// EscapeCode holds the ANSI escape character '\x1B'
EscapeCode = '\x1B'
)
Variables ¶
View Source
var ( // ErrBadControlSequence is an error definition for malformed control // sequences ErrBadControlSequence = errors.New("malformed control sequence") // ControlSequenceIntroducer holds the ANSI control sequence introducer '[' ControlSequenceIntroducer = byte('[') // SelectGraphicRendition holds the ANSI control sequence command 'm' SelectGraphicRendition = byte('m') // CursorPosition holds the ANSI control sequence command 'H' CursorPosition = byte('H') // EraseInDisplay holds the ANSI control sequence command 'J' EraseInDisplay = byte('J') // EraseInLine holds the ANSI control sequence command 'K' EraseInLine = byte('K') // CursorUp holds the ANSI control sequence command 'A' CursorUp = byte('A') // CursorDown holds the ANSI control sequence command 'B' CursorDown = byte('B') // CursorForward holds the ANSI control sequence command 'C' CursorForward = byte('C') // CursorBack holds the ANSI control sequence command 'D' CursorBack = byte('D') )
View Source
var ( // ItemTypeName holds the string names for ItemType ItemTypeName = []string{ "EOF", "RawBytes", "TwoCharSequence", "ControlSequence", } )
Functions ¶
This section is empty.
Types ¶
type Item ¶
Item models a lexer token. The value it hols is the raw slice of bytes extracted from the stream.
type ItemType ¶
type ItemType int
ItemType defines the item class
For references of possible escape sequences, refer to Standard ECMA-48: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer implements reading and tokenizing bytes
type SequenceData ¶
SequenceData is a struct that describes a control sequence
func ParseControlSequence ¶
func ParseControlSequence(v []byte) (*SequenceData, error)
ParseControlSequence takes a slice of bytes as input and returns SequenceData and an error
Click to show internal directories.
Click to hide internal directories.