tokens

package
v0.0.0-...-c9bb408 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package tokens defines the lexical tokens

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token uint8

Token is returned by Lexer to identify the type of token

const (
	Nil Token = iota
	Eof
	Error
	Identifier
	Number
	String
	// Symbol is a #identifier string
	Symbol
	Whitespace
	Comment
	Newline
	// punctuation
	Hash
	Comma
	Semicolon
	At
	LParen
	RParen
	LBracket
	RBracket
	LCurly
	RCurly
	RangeTo
	RangeLen
	OpsStart // operators
	Not
	BitNot
	New
	Dot
	CompareStart // must be consecutive
	Is
	Isnt
	Match
	MatchNot
	Lt // must be consecutive
	Lte
	Gt
	Gte
	CompareEnd
	QMark
	Colon
	AssocStart // must be consecutive
	And
	Or
	BitOr
	BitAnd
	BitXor
	Add
	Sub
	Cat
	Mul
	Div
	AssocEnd
	Mod
	LShift
	RShift
	IncDecStart
	Inc
	PostInc
	Dec
	PostDec
	IncDecEnd
	AssignStart // must be consecutive
	Eq
	AddEq
	SubEq
	CatEq
	MulEq
	DivEq
	ModEq
	LShiftEq
	RShiftEq
	BitOrEq
	BitAndEq
	BitXorEq
	AssignEnd
	In
	// other language keywords
	Break
	Case
	Catch
	Class
	Continue
	Default
	Do
	Else
	False
	For
	Forever
	Function
	If
	Return
	Switch
	Super
	This
	Throw
	True
	Try
	While
	// query keywords
	QueryStart
	SummarizeStart
	Average
	Count
	List
	Max
	Min
	Total
	SummarizeEnd
	Alter
	By
	Cascade
	Create
	Delete
	Drop
	Ensure
	Extend
	History
	Index
	Insert
	Intersect
	Into
	Join
	Key
	Leftjoin
	Lower
	Minus
	Project
	Remove
	Rename
	Reverse
	Set
	Sort
	Summarize
	Sview
	TempIndex
	Times
	To
	Union
	Unique
	Update
	View
	Where
	Ntokens
)

func (Token) IsAssign

func (token Token) IsAssign() bool

func (Token) IsIdent

func (token Token) IsIdent() bool

IsIdent returns whether a token is an identifier. The token must be within the valid range.

func (Token) IsIncDec

func (token Token) IsIncDec() bool

func (Token) IsOperator

func (token Token) IsOperator() bool

func (Token) String

func (i Token) String() string

Jump to

Keyboard shortcuts

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