token

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

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

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

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

	LessThan       = "<"
	LessOrEqual    = "<="
	GreaterThan    = ">"
	GreaterOrEqual = ">="

	// Delimiters
	Comma       = ","
	Semicolon   = ";"
	Colon       = ":"
	DoubleColon = "::"
	Dot         = "."
	DoubleSlash = "//"

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

	// Keywords
	Function = "Function"
	Let      = "Let"
	True     = "True"
	False    = "False"
	If       = "If"
	Else     = "Else"
	Return   = "Return"
	Loop     = "Loop"
	Scope    = "Scope"
	Export   = "Export"
	Load     = "Load"
	Iter     = "Iter"
	Over     = "Over"
	Class    = "Class"
)

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