macro

package
v0.53.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(name string, args []string, kwargs map[string]string) (string, error)

func Expand

func Expand(input string) (string, error)

func ExpandWithOptions

func ExpandWithOptions(input string, opts ExpandOptions) (string, error)

Types

type ExpandOptions

type ExpandOptions struct {
	IgnoreSyntaxErrors bool
}

type Macro

type Macro struct {
	Name string
	Args []MacroArg

	Template        string
	TemplateFuncMap template.FuncMap
	// contains filtered or unexported fields
}

type MacroArg

type MacroArg struct {
	Name     string
	Type     MacroArgType
	Default  string
	Required bool
	Pos      *int
}

type MacroArgType

type MacroArgType string
const (
	MacroArgTypeString MacroArgType = "string"
	MacroArgTypeInt    MacroArgType = "int"
	MacroArgTypeBool   MacroArgType = "bool"
)

type MacroArgument

type MacroArgument struct {
	KV  *MacroKV `parser:"@@ |" json:",omitempty"`
	Arg string   `parser:"@(Key|String)" json:",omitempty"`
}

type MacroExpr

type MacroExpr struct {
	Name      string           `parser:"@MacroName"`
	Arguments []*MacroArgument `parser:"(@@*)"`
}

func ParseExp

func ParseExp(input string) (*MacroExpr, error)

type MacroKV

type MacroKV struct {
	Key   string `parser:"@(Key|String)'='"`
	Value string `parser:"@(Key|Number|String)"`
}

Jump to

Keyboard shortcuts

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