Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Scanner ¶
type Scanner struct { Source string // The consumed line Tokens []Token Start uint16 // Start of each token Current uint16 // Current char position in the line Line uint16 }
func NewScanner ¶
func (*Scanner) ScanTokens ¶
type Token ¶
type TokenType ¶
type TokenType byte
const ( // Single-character tokens LEFT_PAREN TokenType = iota RIGHT_PAREN LEFT_BRACE RIGHT_BRACE COMMA DOT MINUS PLUS SEMICOLON SLASH STAR // One or two character tokens BANG BANG_EQUAL EQUAL EQUAL_EQUAL GREATER GREATER_EQUAL LESS LESS_EQUAL // Literals BOOL IDENTIFIER NUMBER STRING // Keywords/Identifiers AND CLASS CONST ELSE EXTENDS FALSE FOR FUNC IF LET NULL OR PRINT RETURN THIS TRUE EOF )
func GetIdentifier ¶
type TokenValue ¶
Click to show internal directories.
Click to hide internal directories.