stmt

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Append

type Append struct {
	Append string
}

Append represents regular text without any template expressions

func NewAppend

func NewAppend(value string) *Append

NewAppend creates new *Append

type Block

type Block struct {
	Stmt []ast.Statement
}

Block represents block of statements

func (*Block) AddStatement

func (b *Block) AddStatement(statement ast.Statement)

func (*Block) Statements

func (b *Block) Statements() []ast.Statement

type Break added in v0.4.0

type Break struct{}

Break represents #break directive.

type ConditionContainer

type ConditionContainer interface {
	AddCondition(condition *If)
}

type Evaluate

type Evaluate struct {
	X ast.Expression
}

Evaluate represents template expression evaluated in runtime

type ForEach

type ForEach struct {
	Index *expr.Select
	Item  *expr.Select
	Set   ast2.Expression
	Body  Block
}

ForEach represents for each loop

func (*ForEach) AddStatement

func (f *ForEach) AddStatement(statement ast2.Statement)

func (*ForEach) Statements

func (f *ForEach) Statements() []ast2.Statement

type ForLoop added in v0.2.0

type ForLoop struct {
	Init ast2.Statement
	Cond ast2.Expression
	Body Block
	Post ast2.Statement
}

ForLoop represents regular for loop

func (*ForLoop) AddStatement added in v0.2.0

func (r *ForLoop) AddStatement(statement ast2.Statement)

func (*ForLoop) Statements added in v0.2.0

func (r *ForLoop) Statements() []ast2.Statement

type If

type If struct {
	Condition ast2.Expression
	Body      Block
	Else      *If
}

If represents conditional statement

func (*If) AddCondition

func (i *If) AddCondition(next *If)

func (*If) AddStatement

func (i *If) AddStatement(statement ast2.Statement)

func (*If) Statements

func (i *If) Statements() []ast2.Statement

func (*If) Type

func (i *If) Type() reflect.Type

type Statement

type Statement struct {
	X  ast2.Expression //left operand
	Op ast2.Operand    // =
	Y  ast2.Expression //right operand
}

Statement represents assign statement i.e. $var = 10

Jump to

Keyboard shortcuts

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