token

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

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

	Constant         = "CONSTANT"
	Ident            = "IDENT"
	InstanceVariable = "INSTANCE_VAR"
	Int              = "INT"
	Float            = "FLOAT"
	String           = "STRING"
	Comment          = "COMMENT"

	Assign   = "="
	Plus     = "+"
	PlusEq   = "+="
	Minus    = "-"
	MinusEq  = "-="
	Bang     = "!"
	Asterisk = "*"
	Pow      = "**"
	Slash    = "/"
	Dot      = "."
	And      = "&&"
	Or       = "||"
	OrEq     = "||="
	Modulo   = "%"

	Match = "=~"
	LT    = "<"
	LTE   = "<="
	GT    = ">"
	GTE   = ">="
	COMP  = "<=>"

	Comma     = ","
	Semicolon = ";"
	Colon     = ":"
	Bar       = "|"

	LParen   = "("
	RParen   = ")"
	LBrace   = "{"
	RBrace   = "}"
	LBracket = "["
	RBracket = "]"

	Eq    = "=="
	NotEq = "!="
	Range = ".."

	True     = "TRUE"
	False    = "FALSE"
	Null     = "Null"
	If       = "IF"
	ElsIf    = "ELSIF"
	Else     = "ELSE"
	Case     = "CASE"
	When     = "WHEN"
	Return   = "RETURN"
	Next     = "NEXT"
	Break    = "BREAK"
	Def      = "DEF"
	Self     = "SELF"
	End      = "END"
	While    = "WHILE"
	Do       = "DO"
	Yield    = "YIELD"
	GetBlock = "GET_BLOCK"
	Class    = "CLASS"
	Module   = "MODULE"

	ResolutionOperator = "::"
)

Literals

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    Type
	Literal string
	Line    int
}

Token is structure for identifying input stream of characters

type Type

type Type string

Type is used to determite token type

func LookupIdent

func LookupIdent(ident string) Type

LookupIdent is used for keyword identification

Jump to

Keyboard shortcuts

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