token.go 454 B

12345678910111213141516171819202122232425262728293031323334
  1. package token
  2. type TokenType string
  3. type Token struct {
  4. Type TokenType
  5. Literal string
  6. }
  7. const (
  8. ILLEGAL = "ILLEGAL"
  9. EOF = "EOF"
  10. // Identifiers + literals.
  11. IDENT = "IDENT" // add, foobar, x, y, ...
  12. INT = "INT" // 123456, ...
  13. // Operators.
  14. ASSIGN = "="
  15. PLUS = "+"
  16. // Delimiters.
  17. COMMA = ","
  18. SEMICOLON = ";"
  19. LPAREN = "("
  20. RPAREN = ")"
  21. LBRACE = "{"
  22. RBRACE = "}"
  23. // Keywords
  24. FUNCTION = "FUNCTION"
  25. LET = "LET"
  26. )