35 lines
444 B
Go
35 lines
444 B
Go
|
package token
|
||
|
|
||
|
type TokenType string
|
||
|
|
||
|
type Token struct {
|
||
|
Type TokenType
|
||
|
Literal string
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
ILLEGAL = "ILLEGAL"
|
||
|
EOF = "EOF"
|
||
|
|
||
|
//Identifiers and literals
|
||
|
IDENT = "IDENT" //add, foo, bar, a, b, c...
|
||
|
INT = "INT" /// 1 2 3 4 5
|
||
|
|
||
|
//OPERATORS
|
||
|
ASSIGN = "="
|
||
|
PLUS = "+"
|
||
|
|
||
|
//DELIM
|
||
|
COMMA = ""
|
||
|
SEMICOLON = ";"
|
||
|
|
||
|
LPAREN = "("
|
||
|
RPAREN = ")"
|
||
|
LBRACE = "{"
|
||
|
RBRACE = "}"
|
||
|
|
||
|
// KEYWORDS
|
||
|
FUNCTION = "FUNCTION"
|
||
|
LET = "LET"
|
||
|
)
|