exprs

package
v0.0.0-...-016edcc Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EOF = rune(-1)

Variables

View Source
var ErrNotExpr = errors.New("not an expr")

Functions

func Exec

func Exec(s string, funcs map[string]Func) (string, error)

func ExecDeep

func ExecDeep(ctx context.Context, obj any, funcs map[string]Func) error

Types

type Expr

type Expr struct {
	String    string
	Function  string
	PosArgs   []string
	NamedArgs []ExprArg
}

func Parse

func Parse(s string) (Expr, error)

func (Expr) MustPosArg

func (e Expr) MustPosArg(n int) (string, error)

func (Expr) NamedArg

func (e Expr) NamedArg(name string) string

func (Expr) PosArg

func (e Expr) PosArg(n int, def string) string

type ExprArg

type ExprArg struct {
	Name  string
	Value string
}

type Func

type Func func(expr Expr) (string, error)

Jump to

Keyboard shortcuts

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