Documentation ¶
Index ¶
- Constants
- Variables
- func Match(t1, t2 Token) bool
- type Token
- func (t Token) IsFloat() bool
- func (t Token) IsFloatInt() bool
- func (t Token) IsIdentRune(ch rune, i int) bool
- func (t Token) IsIdentifier() bool
- func (t Token) IsInt() bool
- func (t Token) IsKeyword() bool
- func (t Token) IsNumber() bool
- func (t Token) IsOperator() bool
- func (t Token) IsSingleCharIdentifier() bool
- func (t Token) IsString() bool
- func (t Token) String() string
- type TokenCollector
- type Type
Constants ¶
View Source
const ( ILLEGAL = "ILLEGAL" UNKNOWN = "UNKNOWN" EOF = "EOF" // Literals STRING = "string" NUMBER = "number" FLOAT = "float" BOOL = "bool" // Operators ASSIGN = "=" INFER = ":=" PLUS = "+" PLUS_EQUALS = "+=" MINUS = "-" MINUS_EQUALS = "-=" ASTERISK = "*" ASTERISK_EQUALS = "*=" SLASH = "/" SLASH_EQUALS = "/=" MOD = "%" AND = "&&" AMPERSAND = "&" OR = "||" PIPE = "|" EQ = "==" NOT_EQ = "!=" LT = "<" LT_EQUALS = "<=" GT = ">" GT_EQUALS = ">=" QUESTION = "?" SLASH_SLASH = "//" SLASH_ASTERISK = "/*" ASTERISK_SLASH = "/*" // Delimiters COMMA = "," COLON = ":" SEMICOLON = ";" DOT = "." LPAREN = "(" RPAREN = ")" LBRACE = "{" RBRACE = "}" LBRACKET = "[" RBRACKET = "]" // Keywords FUNCTION = "FUNCTION" CONST = "CONST" LET = "LET" RETURN = "RETURN" IF = "if" ELSE = "else" PUB = "pub" PACKAGE = "pkg" IMPORT = "import" INTERFACE = "interface" STRUCT = "struct" TEST = "test" ENUM = "enum" DEFER = "defer" IDENTIFIER = "IDENTIFIER" TRUE = "true" FALSE = "false" BANG = "!" )
Token types
View Source
const ( U8 = "u8" U16 = "u16" U32 = "u32" U64 = "u64" I8 = "i8" I16 = "i16" I32 = "i32" I64 = "i64" F32 = "f32" F64 = "f64" )
Variables ¶
Functions ¶
Types ¶
type Token ¶
func (Token) IsFloatInt ¶
func (Token) IsIdentifier ¶
func (Token) IsOperator ¶
func (Token) IsSingleCharIdentifier ¶
type TokenCollector ¶
Click to show internal directories.
Click to hide internal directories.