types

package
v0.24.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Precedence = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument interface {
	// contains filtered or unexported methods
}

Argument, a marker for zero-artiy functions.

type Bool

type Bool bool

Bool, a zero-arity function returning a true/false value.

func (Bool) Arity

func (Bool) Arity() int

func (Bool) Precedence

func (Bool) Precedence() int

func (Bool) String

func (k Bool) String() string

func (Bool) Value

func (k Bool) Value() bool

type Builtin

type Builtin struct {
	Type           BuiltinType
	ParameterCount int
}

Builtin, a dynamic-arity function referring to one of a small set predefined commands. See also: BuiltinType.

func (Builtin) Arity

func (k Builtin) Arity() int

func (Builtin) Precedence

func (k Builtin) Precedence() int

func (Builtin) String

func (k Builtin) String() string

type BuiltinType

type BuiltinType int
const (
	// Joins several expressions into a single result.
	// For example, if multiple strings live side by side
	Span BuiltinType = iota
	// sequences holds a set of potentially repeating text.
	Stopping
	Shuffle
	Cycle
	// arity varies based on whether there's an else statement
	IfStatement
	UnlessStatement
)

func (BuiltinType) String

func (i BuiltinType) String() string

type Command

type Command struct {
	CommandName  string
	CommandArity int
}

Command, a dynamic-arity function referring to some externally defined command.

func (Command) Arity

func (k Command) Arity() int

func (Command) Precedence

func (k Command) Precedence() int

func (Command) String

func (k Command) String() string

type Number

type Number float64

Number, a zero-arity function returning a number.

func (Number) Arity

func (Number) Arity() int

func (Number) Precedence

func (Number) Precedence() int

func (Number) String

func (k Number) String() string

func (Number) Value

func (k Number) Value() float64

type Operator

type Operator int

Operator, built-in binary functions (arity of two).

const (
	MUL Operator = (5 << Precedence) | iota
	QUO Operator = (5 << Precedence) | iota
	REM Operator = (5 << Precedence) | iota

	ADD Operator = (4 << Precedence) | iota
	SUB Operator = (4 << Precedence) | iota

	EQL Operator = (3 << Precedence) | iota
	NEQ Operator = (3 << Precedence) | iota
	LSS Operator = (3 << Precedence) | iota
	LEQ Operator = (3 << Precedence) | iota
	GTR Operator = (3 << Precedence) | iota
	GEQ Operator = (3 << Precedence) | iota

	LAND Operator = (2 << Precedence) | iota
	LOR  Operator = (1 << Precedence) | iota
)

func (Operator) Arity

func (i Operator) Arity() int

Arity of operator is two.

func (Operator) Precedence

func (i Operator) Precedence() int

Precedence of the corresponding infix operator.

func (Operator) String

func (i Operator) String() string

type Quote

type Quote string

Quote, a zero-arity function returning a string.

func (Quote) Arity

func (Quote) Arity() int

func (Quote) Precedence

func (Quote) Precedence() int

func (Quote) String

func (k Quote) String() string

func (Quote) Value

func (k Quote) Value() string

type Reference

type Reference []string

Reference, a zero-arity function containing the path to an object property.

func (Reference) Arity

func (Reference) Arity() int

func (Reference) Precedence

func (Reference) Precedence() int

func (Reference) String

func (k Reference) String() string

func (Reference) Value

func (r Reference) Value() []string

Jump to

Keyboard shortcuts

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