Documentation
¶
Index ¶
Constants ¶
View Source
const ( VALID_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_" NUMS = "0123456789" SPECIAL_CHARS = "(){}[]" WHITESPACE = " \t\r" )
View Source
const EOF rune = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer struct { Errors error // contains filtered or unexported fields }
func (*Lexer) Emit ¶
Emit will receive a token type and push a new token with the current analyzed value into the tokens channel.
func (*Lexer) Ignore ¶
func (l *Lexer) Ignore()
Ignore clears the rewind stack and then sets the current beginning pos to the current pos in the source which effectively ignores the section of the source being analyzed.
func (*Lexer) Next ¶
Next pulls the next rune from the Lexer and returns it, moving the pos forward in the source.
func (*Lexer) Peek ¶
Peek performs a Next operation immediately followed by a Rewind returning the peeked rune.
type StateFunc ¶
func IdentifierState ¶
func NumberState ¶
func SpecialState ¶
func WhitespaceState ¶
Click to show internal directories.
Click to hide internal directories.