Documentation
¶
Overview ¶
Builder to format numscript document
Index ¶
- type Destination
- type ExprType
- type ExprTypeAccount
- type ExprTypeAsset
- type ExprTypeMonetary
- type ExprTypeNumber
- type ExprTypeString
- type Expression
- func ExprAccount(name string) Expression[ExprTypeAccount]
- func ExprAsset(name string) Expression[ExprTypeAsset]
- func ExprMonetary(asset Expression[ExprTypeAsset], amount Expression[ExprTypeNumber]) Expression[ExprTypeMonetary]
- func ExprNumberBigInt(amount *big.Int) Expression[ExprTypeNumber]
- func ExprString(name string) Expression[ExprTypeString]
- func ExprVar[T ExprType](v *Var[T]) Expression[T]
- type Overdraft
- type Source
- func SrcAccount(expr Expression[ExprTypeAccount]) Source
- func SrcAccountOverdraft(expr Expression[ExprTypeAccount], overdraft Overdraft) Source
- func SrcColored(accountExpr Expression[ExprTypeAccount], colorExpr Expression[ExprTypeString]) Source
- func SrcColoredOverdraft(accountExpr Expression[ExprTypeAccount], colorExpr Expression[ExprTypeString], ...) Source
- func SrcInorder(sources ...Source) Source
- type Statement
- type Var
- type VarsEnv
- func (v VarsEnv) FillAccount(var_ *Var[ExprTypeAccount], account string) (string, string)
- func (v VarsEnv) FillAsset(var_ *Var[ExprTypeAsset], asset string) (string, string)
- func (v VarsEnv) FillNumber(var_ *Var[ExprTypeNumber], bi *big.Int) (string, string)
- func (v VarsEnv) FillString(var_ *Var[ExprTypeString], str string) (string, string)
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 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 ExprMonetary ¶
func ExprMonetary( asset Expression[ExprTypeAsset], amount Expression[ExprTypeNumber], ) Expression[ExprTypeMonetary]
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 ¶
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 ¶
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 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 (VarsEnv) FillNumber ¶
func (VarsEnv) FillString ¶
Click to show internal directories.
Click to hide internal directories.