token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package token implements types and constants.

Index

Constants

View Source
const (
	// Literals
	Identifier = "IDENTIFIER"
	Boolean    = "BOOLEAN"
	String     = "STRING"
	Integer    = "INTEGER"
	Float      = "FLOAT"
	// Operators
	Assign         = "="
	PlusAssign     = "+="
	MinusAssign    = "-="
	MultiplyAssign = "*="
	DivideAssign   = "/="
	Equal          = "=="
	NotEqual       = "!="
	Greater        = ">"
	GreaterEqual   = ">="
	Less           = "<"
	LessEqual      = "<="
	Plus           = "+"
	Minus          = "-"
	Multiply       = "*"
	Exponential    = "**"
	Modulus        = "%"
	Divide         = "/"
	BitwiseOr      = "|"
	BitwiseAnd     = "&"
	BitwiseNot     = "~"
	BitShiftLeft   = "<<"
	BitShiftRight  = ">>"
	LogicalOr      = "||"
	LogicalAnd     = "&&"
	Not            = "!"
	Pipe           = "|>"
	Arrow          = "->"
	FatArrow       = "=>"
	QuestionMark   = "?"
	// Delimiters
	Space            = " "
	NewLine          = "\n"
	LeftParenthesis  = "("
	LeftBracket      = "["
	LeftBraces       = "{"
	RightParenthesis = ")"
	RightBracket     = "]"
	RightBraces      = "}"
	Colon            = ":"
	SemiColon        = ";"
	Range            = ".."
	Ellipsis         = "..."
	Dot              = "."
	Comma            = ","
	Underscore       = "_"
	// Keywords
	Val      = "val"
	Var      = "var"
	Function = "fn"
	Do       = "do"
	End      = "end"
	Then     = "then"
	If       = "if"
	Else     = "else"
	Repeat   = "repeat"
	In       = "in"
	Is       = "is"
	As       = "as"
	Nil      = "nil"
	Return   = "return"
	Match    = "match"
	With     = "with"
	When     = "when"
	Break    = "break"
	Continue = "continue"
	Module   = "module"
	Use      = "use"
	True     = "true"
	False    = "false"
	// Miscellaneous
	Comment = "COMMENT"
	Eof     = "EOF"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position struct {
	Row int
	Col int
}

type TType

type TType string

type Token

type Token struct {
	Type     TType
	Literal  string
	Position Position
}

Jump to

Keyboard shortcuts

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