token

package
v0.0.0-...-5ff04a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ILLEGAL = "ILLEGAL"
	EOF     = "EOF"

	// Identifier and Literals
	ID     = "ID"
	INT    = "INT"
	STRING = "STRING"

	// Operators
	ASSIGN   = "="
	PLUS     = "+"
	MINUS    = "-"
	BANG     = "!"
	ASTERISK = "*"
	SLASH    = "/"

	LESS    = "<"
	GREATER = ">"

	EQUAL  = "=="
	NOT_EQ = "!="

	// Delimiters
	COMMA     = ","
	SEMICOLON = ";"
	COLON     = ":"

	L_PAREN   = "("
	R_PAREN   = ")"
	L_BRACKET = "["
	R_BRACKET = "]"
	L_BRACE   = "{"
	R_BRACE   = "}"

	// keywords
	LET      = "LET"
	RETURN   = "RETURN"
	FUNCTION = "FUNCTION"
	MACRO    = "MACRO"

	IF    = "IF"
	ELSE  = "ELSE"
	TRUE  = "TRUE"
	FALSE = "FALSE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    TokenType
	Literal string
}

type TokenType

type TokenType string

func LookupIdentifier

func LookupIdentifier(ident string) TokenType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL