token

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    Type
	Literal string
	Line    int
	Column  int
	Raw     string
}

func CreateOperator

func CreateOperator(literal string, line, column int) Token

func CreateSeparator

func CreateSeparator(literal string, line, column int) Token

type Type

type Type string
const (
	Illegal Type = "ILLEGAL"
	EOF     Type = "EOF"

	Ident        Type = "IDENT"
	Int          Type = "INT"
	Float        Type = "FLOAT"
	String       Type = "STRING"
	InterpString Type = "INTERP_STRING"

	Plus     Type = "+"
	Minus    Type = "-"
	Asterisk Type = "*"
	Slash    Type = "/"
	Percent  Type = "%"
	Caret    Type = "^"
	FloorDiv Type = "//"

	Hash Type = "#"

	PlusAssign   Type = "+="
	MinusAssign  Type = "-="
	MulAssign    Type = "*="
	DivAssign    Type = "/="
	BorAssign    Type = "|="
	BandAssign   Type = "&="
	LShiftAssign Type = "<<="
	RShiftAssign Type = ">>="

	Ampersand Type = "&"
	Pipe      Type = "|"
	Tilde     Type = "~"
	LShift    Type = "<<"
	RShift    Type = ">>"

	Eq    Type = "=="
	NotEq Type = "~="
	LT    Type = "<"
	LTE   Type = "<="
	GT    Type = ">"
	GTE   Type = ">="

	Assign Type = "="

	Question    Type = "?"
	QuestionDot Type = "?."
	Coalesce    Type = "??"
	Arrow       Type = "->"
	PipeArrow   Type = "|>"

	And Type = "AND"
	Or  Type = "OR"
	Not Type = "NOT"

	Comma     Type = ","
	Semicolon Type = ";"
	Colon     Type = ":"
	Dot       Type = "."
	Concat    Type = ".."
	Vararg    Type = "..."
	Label     Type = "::"

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

	True     Type = "TRUE"
	False    Type = "FALSE"
	Nil      Type = "NIL"
	If       Type = "IF"
	ElseIf   Type = "ELSEIF"
	Else     Type = "ELSE"
	Then     Type = "THEN"
	End      Type = "END"
	Do       Type = "DO"
	While    Type = "WHILE"
	Repeat   Type = "REPEAT"
	Until    Type = "UNTIL"
	For      Type = "FOR"
	In       Type = "IN"
	Function Type = "FUNCTION"
	Local    Type = "LOCAL"
	Return   Type = "RETURN"
	Break    Type = "BREAK"
	Goto     Type = "GOTO"
	Match    Type = "MATCH"
	Enum     Type = "ENUM"
	Defer    Type = "DEFER"
	Try      Type = "TRY"
	Catch    Type = "CATCH"
	Throw    Type = "THROW"
)

func LookupIdent

func LookupIdent(ident string) Type

Jump to

Keyboard shortcuts

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