builder

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Builder to format numscript document

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination render

func DestAccount

func DestAccount(expr Expression[ExprTypeAccount]) Destination

type ExprType

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

type ExprTypeAccount

type ExprTypeAccount interface {
	ExprType
	// contains filtered or unexported methods
}

type ExprTypeAsset

type ExprTypeAsset interface {
	ExprType
	// contains filtered or unexported methods
}

type ExprTypeMonetary

type ExprTypeMonetary interface {
	ExprType
	// contains filtered or unexported methods
}

type ExprTypeNumber

type ExprTypeNumber interface {
	ExprType
	// contains filtered or unexported methods
}

type ExprTypeString

type ExprTypeString interface {
	ExprType
	// contains filtered or unexported methods
}

type Expression

type Expression[T ExprType] render

func ExprAccount

func ExprAccount(name string) Expression[ExprTypeAccount]

func ExprAsset

func ExprAsset(name string) Expression[ExprTypeAsset]

func ExprNumberBigInt

func ExprNumberBigInt(amount *big.Int) Expression[ExprTypeNumber]

func ExprString

func ExprString(name string) Expression[ExprTypeString]

func ExprVar

func ExprVar[T ExprType](v *Var[T]) Expression[T]

type Overdraft

type Overdraft render

func BoundedOverdraft

func BoundedOverdraft(amt Expression[ExprTypeMonetary]) Overdraft

func UnboundedOverdraft

func UnboundedOverdraft() Overdraft

type Source

type Source render

func SrcAccount

func SrcAccount(expr Expression[ExprTypeAccount]) Source

func SrcAccountOverdraft

func SrcAccountOverdraft(
	expr Expression[ExprTypeAccount],
	overdraft Overdraft,
) Source

func SrcColored

func SrcColored(
	accountExpr Expression[ExprTypeAccount],
	colorExpr Expression[ExprTypeString],
) Source

func SrcColoredOverdraft

func SrcColoredOverdraft(
	accountExpr Expression[ExprTypeAccount],
	colorExpr Expression[ExprTypeString],
	overdraft Overdraft,
) Source

func SrcInorder

func SrcInorder(sources ...Source) Source

type Statement

type Statement render

func StmtSend

func StmtSend(
	monetary Expression[ExprTypeMonetary],
	source Source,
	destination Destination,
) Statement

A bounded send statement

func StmtSendAll

func StmtSendAll(
	asset Expression[ExprTypeAsset],
	source Source,
	destination Destination,
) Statement

An unbounded send statement

type Var

type Var[T ExprType] var_[ExprType]

func NewAccountVar

func NewAccountVar() Var[ExprTypeAccount]

func NewAssetVar

func NewAssetVar() Var[ExprTypeAsset]

func NewNumberVar

func NewNumberVar() Var[ExprTypeNumber]

func NewStringVar

func NewStringVar() Var[ExprTypeString]

type VarsEnv

type VarsEnv struct {
	// contains filtered or unexported fields
}

func BuildProgram

func BuildProgram(statements ...Statement) (map[string]string, VarsEnv, string)

func BuildProgramWithFeatureFlags

func BuildProgramWithFeatureFlags(
	featureFlags []string,
	statements ...Statement,
) (map[string]string, VarsEnv, string)

Same as `BuildProgram`, but accepts features flag.

IMPORTANT NOTE: this function will panic if a feature flag doesn't match `^[a-z-]+$`. Flags are meant to be passed directly, and a sintactically incorrect flag is treated as an argument error panic right away, not returned as an "error". Also note we don't keep the list of valid flags here

func (VarsEnv) FillAccount

func (v VarsEnv) FillAccount(var_ *Var[ExprTypeAccount], account string) (string, string)

func (VarsEnv) FillAsset

func (v VarsEnv) FillAsset(var_ *Var[ExprTypeAsset], asset string) (string, string)

func (VarsEnv) FillNumber

func (v VarsEnv) FillNumber(var_ *Var[ExprTypeNumber], bi *big.Int) (string, string)

func (VarsEnv) FillString

func (v VarsEnv) FillString(var_ *Var[ExprTypeString], str string) (string, string)

Jump to

Keyboard shortcuts

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