token

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

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

	// Identifiers + literals
	IDENT  = "IDENT"  // add, foobar, x, y, ...
	INT    = "INT"    // 1343456
	STRING = "STRING" // "foobar"
	NULL   = "NULL"   // null

	// Operators
	ASSIGN   = "="
	PLUS     = "+"
	MINUS    = "-"
	BANG     = "!"
	ASTERISK = "*"
	SLASH    = "/"
	CONCAT   = "."
	MATCH    = "=~"
	NO_MATCH = "!~"
	LAND     = "&&"
	LOR      = "||"

	// Number
	FLOAT    = "FLOAT"
	NEGATIVE = "-"

	// Comparisons
	LT     = "<"
	LT_EQ  = "<="
	GT     = ">"
	GT_EQ  = ">="
	EQ     = "=="
	NOT_EQ = "!="

	// Delimiters
	COMMA     = ","
	SEMICOLON = ";"
	COLON     = ":"

	LPAREN   = "("
	RPAREN   = ")"
	LBRACE   = "{"
	RBRACE   = "}"
	LBRACKET = "["
	RBRACKET = "]"

	// Keywords
	FUNCTION = "FUNCTION"
	LET      = "LET"
	SET      = "SET"
	TRUE     = "TRUE"
	FALSE    = "FALSE"
	IF       = "IF"
	ELSE     = "ELSE"
	RETURN   = "RETURN"
	WHEN     = "WHEN"
	SELECT   = "SELECT"
	AS       = "AS"
	DEFAULT  = "DEFAULT"
	WITH     = "WITH"
	PRIORITY = "PRIORITY"
	EXEC     = "EXEC"
	EMIT     = "EMIT"

	// Filtering
	BRANCH = "BRANCH"
	STAR   = "STAR"
	REGEX  = "REGEX"

	// Function-call sigil. `&fn(args...)` introduces a runtime
	// function-call value. Literal carries the identifier (no `&`).
	// See internal docs/todo-txcl-expressions.md.
	AMP_IDENT = "AMP_IDENT"
)

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 LookupIdent

func LookupIdent(ident string) TokenType

Jump to

Keyboard shortcuts

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