Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyToken = Token{Type: TTEOF, Lexeme: ""}
Functions ¶
func TokenTypeName ¶
Types ¶
type Token ¶
Token represents a lexed Token
func Lex ¶
Lex walks the specified string and returns an array of lexed Tokens or an non-nil error if the input could not be lexed.
func (Token) ParseColor ¶
func (Token) ParseNumber ¶
func (Token) ParseString ¶
type TokenType ¶
type TokenType int
TokenType represents the type of Token
const ( TTNumber TokenType = iota TTIdent TTString TTColor TTAnd TTOr TTColonEq TTEq TTEqEq TTNeq TTGt TTGe TTLt TTLe TTPlus TTMinus TTStar TTSlash TTPercent TTLParen TTRParen TTNot TTAt TTComma TTDot TTSemicolon TTFor TTIn TTYield TTDotDot TTIf TTElse TTLBrace TTRBrace TTLBracket TTRBracket TTTrue TTFalse TTQMark TTColon TTLog TTFn TTReturn TTArrow TTNil TTPipe TTColonColon TTWhile TTDollar TTEOF )
The types of tokens that can be lexed
Click to show internal directories.
Click to hide internal directories.