token

package
v0.0.0-...-43051ef Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2019 License: MIT Imports: 0 Imported by: 13

Documentation

Index

Constants

View Source
const (
	Illegal = "Illegal"
	EOF     = "EOF"

	// Identifiers + Literals
	Identifier = "Identifier" // add, x ,y, ...
	Int        = "Int"        // 123456
	String     = "String"     // "x", "y"

	// Operators
	Assign   = "="
	Plus     = "+"
	Minus    = "-"
	Bang     = "!"
	Asterisk = "*"
	Slash    = "/"
	Equal    = "=="
	NotEqual = "!="

	LessThan    = "<"
	GreaterThan = ">"

	// Delimiters
	Comma     = ","
	Semicolon = ";"
	Colon     = ":"

	LeftParen    = "("
	RightParen   = ")"
	LeftBrace    = "{"
	RightBrace   = "}"
	LeftBracket  = "["
	RightBracket = "]"

	// Keywords
	Function = "Function"
	Let      = "Let"
	True     = "True"
	False    = "False"
	If       = "If"
	Else     = "Else"
	Return   = "Return"
)

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 LookupIdentifierType

func LookupIdentifierType(identifier string) TokenType

Jump to

Keyboard shortcuts

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