token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT 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"
	REGEXP = "REGEXP" // /^v1.0/
	SHELL  = "SHELL"  // $branch, ${branch:-fallback}

	BANG = "!"
	DOT  = "."

	// Comparison Operators
	EQ        = "=="
	NOT_EQ    = "!="
	RE_EQ     = "=~"
	RE_NOT_EQ = "!~"
	INCLUDES  = "includes"

	// Boolean Operators
	AND = "&&"
	OR  = "||"

	// Delimiters
	QUESTION = "?"
	COLON    = ":"
	COMMA    = ","
	LPAREN   = "("
	RPAREN   = ")"
	LBRACKET = "["
	RBRACKET = "]"

	// Keywords
	TRUE  = "TRUE"
	FALSE = "FALSE"
	NULL  = "NULL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    TokenType
	Literal string
	Flags   string
	Raw     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