Documentation ¶
Index ¶
Constants ¶
View Source
const EOF rune = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenLimitReachedError ¶
func (TokenLimitReachedError) Error ¶
func (TokenLimitReachedError) Error() string
func (TokenLimitReachedError) IsUserError ¶
func (TokenLimitReachedError) IsUserError()
type TokenStream ¶
type TokenStream interface { // Next consumes and returns one Token. If there are no tokens remaining, it returns Token{TokenEOF} Next() Token Cursor() int Revert(cursor int) // Input returns the whole input as source code Input() []byte Reclaim() }
func Lex ¶
func Lex(input []byte, memoryGauge common.MemoryGauge) TokenStream
type TokenType ¶
type TokenType uint8
const ( TokenError TokenType = iota TokenEOF TokenSpace TokenBinaryIntegerLiteral TokenOctalIntegerLiteral TokenDecimalIntegerLiteral TokenHexadecimalIntegerLiteral TokenUnknownBaseIntegerLiteral TokenFixedPointNumberLiteral TokenIdentifier TokenString TokenPlus TokenMinus TokenStar TokenSlash TokenPercent TokenDoubleQuestionMark TokenParenOpen TokenParenClose TokenBraceOpen TokenBraceClose TokenBracketOpen TokenBracketClose TokenQuestionMark TokenQuestionMarkDot TokenComma TokenColon TokenDot TokenSemicolon TokenLeftArrow TokenLeftArrowExclamation TokenRightArrow TokenSwap TokenLess TokenLessEqual TokenLessLess TokenGreater TokenGreaterEqual TokenEqual TokenEqualEqual TokenExclamationMark TokenNotEqual TokenBlockCommentStart TokenBlockCommentEnd TokenBlockCommentContent TokenLineComment TokenAmpersand TokenAmpersandAmpersand TokenCaret TokenVerticalBar TokenVerticalBarVerticalBar TokenAt TokenAsExclamationMark TokenAsQuestionMark TokenPragma // NOTE: not an actual token, must be last item TokenMax )
func (TokenType) IsIntegerLiteral ¶
Click to show internal directories.
Click to hide internal directories.