Documentation ¶
Index ¶
- Constants
- type Assign
- type BinaryExpr
- type Block
- type Builder
- type CallExpr
- type Condition
- type ConditionalBlock
- type DerefExpression
- type ErrorCheck
- type Expression
- type Foreach
- type FuncArg
- type Function
- type Ident
- type Insert
- type LiteralExpr
- type MapExpr
- type Node
- type Options
- type Receiver
- type RefExpression
- type ReturnExpr
- type Scope
- type SelectorExpr
- type Statement
- type StatementExpression
- type TerminatorExpression
- type Update
- type Variable
Constants ¶
View Source
const ( LangVelty = "velty" LangGO = "go" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assign ¶
type Assign struct { Holder Expression ExtraHolders []Expression Expression Expression }
func NewAssign ¶
func NewAssign(holder Expression, expr Expression) *Assign
type BinaryExpr ¶
type BinaryExpr struct { X Expression Op string Y Expression }
func NewBinary ¶
func NewBinary(x Expression, op string, y Expression) *BinaryExpr
func (*BinaryExpr) Generate ¶
func (s *BinaryExpr) Generate(builder *Builder) (err error)
type Block ¶
type Block []Statement
func (*Block) AppendEmptyLine ¶
func (b *Block) AppendEmptyLine()
type Builder ¶
type Builder struct { *strings.Builder Options Indent string State *Scope IndexByCode *Builder // contains filtered or unexported fields }
func NewBuilder ¶
func (*Builder) NewBuilder ¶ added in v0.10.0
func (*Builder) WriteIndentedString ¶
func (*Builder) WriteString ¶
type CallExpr ¶
type CallExpr struct { Terminator bool Receiver Expression Name string Args []Expression }
func NewCallExpr ¶
func NewCallExpr(holder Expression, name string, args ...Expression) *CallExpr
type Condition ¶
type Condition struct { If Expression IFBlock Block ElseIfBlocks []*ConditionalBlock ElseBlock Block }
func NewCondition ¶
func NewCondition(ifExpr Expression, ifBlock, elseBlock Block) *Condition
type ConditionalBlock ¶
type ConditionalBlock struct { If Expression Block Block }
type DerefExpression ¶
type DerefExpression struct {
X Expression
}
func NewDerefExpression ¶
func NewDerefExpression(x Expression) *DerefExpression
func (*DerefExpression) Generate ¶
func (s *DerefExpression) Generate(builder *Builder) error
type ErrorCheck ¶
type ErrorCheck struct {
X Expression
}
func NewErrorCheck ¶
func NewErrorCheck(expr Expression) *ErrorCheck
func (*ErrorCheck) Generate ¶
func (e *ErrorCheck) Generate(builder *Builder) error
type Expression ¶
type Expression interface { Node } //can be BinaryExpr or CallExpr or QuerySelector Expr
type Foreach ¶
func NewForEach ¶
type Function ¶
type Ident ¶
func NewHolderIndent ¶ added in v0.10.0
type LiteralExpr ¶
type LiteralExpr struct {
Literal string
}
func NewLiteral ¶
func NewLiteral(text string) *LiteralExpr
func NewQuotedLiteral ¶
func NewQuotedLiteral(text string) *LiteralExpr
func (*LiteralExpr) Generate ¶
func (s *LiteralExpr) Generate(builder *Builder) error
type MapExpr ¶
type MapExpr struct { Map Expression Key Expression }
type Options ¶
type Options struct { Lang string StateName string CallNotifier func(callExpr *CallExpr) (Expression, error) AssignNotifier func(assign *Assign) (Expression, error) SliceItemNotifier func(value, set *Ident) error WithoutBusinessLogic bool OnIfNotifier func(value *Condition) (Expression, error) WithLowerCaseIdent bool }
type RefExpression ¶
type RefExpression struct {
X Expression
}
func NewRefExpression ¶
func NewRefExpression(x Expression) *RefExpression
func (*RefExpression) Generate ¶
func (s *RefExpression) Generate(builder *Builder) error
type ReturnExpr ¶
type ReturnExpr struct {
X Expression
}
func NewReturnExpr ¶
func NewReturnExpr(expr Expression) *ReturnExpr
func (*ReturnExpr) Generate ¶
func (r *ReturnExpr) Generate(builder *Builder) error
type SelectorExpr ¶
type SelectorExpr struct { Ident X *SelectorExpr }
func (*SelectorExpr) Generate ¶
func (s *SelectorExpr) Generate(builder *Builder) error
type StatementExpression ¶
type StatementExpression struct {
Expression
}
func NewStatementExpression ¶
func NewStatementExpression(expr Expression) *StatementExpression
NewStatementExpression return new statement expr
func (*StatementExpression) Generate ¶
func (s *StatementExpression) Generate(builder *Builder) (err error)
type TerminatorExpression ¶
type TerminatorExpression struct {
X Expression
}
func NewTerminatorExpression ¶
func NewTerminatorExpression(x Expression) *TerminatorExpression
func (TerminatorExpression) Generate ¶
func (b TerminatorExpression) Generate(builder *Builder) error
Click to show internal directories.
Click to hide internal directories.