statement

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	LHS []astgen.ASTExpr
	Tok token.Token
	RHS astgen.ASTExpr
}

func NewAssignment

func NewAssignment(lhs astgen.ASTExpr, tok token.Token, rhs astgen.ASTExpr) *Assignment

func (*Assignment) ASTStmt

func (a *Assignment) ASTStmt() ast.Stmt

type Block

type Block struct {
	Statments []astgen.ASTStmt
}

Block represents a block of statements wrapped by braces ("{" and "}"). Useful for the Else block of an If statement.

func NewBlock

func NewBlock(stmts ...astgen.ASTStmt) *Block

func (*Block) ASTStmt

func (b *Block) ASTStmt() ast.Stmt

type CaseClause

type CaseClause struct {
	Exprs []astgen.ASTExpr
	Body  []astgen.ASTStmt
}

func NewCaseClause

func NewCaseClause(expr astgen.ASTExpr, body ...astgen.ASTStmt) *CaseClause

func (*CaseClause) ASTStmt

func (c *CaseClause) ASTStmt() ast.Stmt

type Decl

type Decl struct {
	Decl astgen.ASTDecl
}

func NewDecl

func NewDecl(decl astgen.ASTDecl) *Decl

func (*Decl) ASTStmt

func (d *Decl) ASTStmt() ast.Stmt

type Defer

type Defer struct {
	Call *expression.CallExpression
}

func (*Defer) ASTStmt

func (d *Defer) ASTStmt() ast.Stmt

type Expression

type Expression struct {
	Expr astgen.ASTExpr
}

func NewExpression

func NewExpression(expr astgen.ASTExpr) *Expression

func (*Expression) ASTStmt

func (e *Expression) ASTStmt() ast.Stmt

type If

type If struct {
	Init astgen.ASTStmt
	Cond astgen.ASTExpr
	Body []astgen.ASTStmt
	Else astgen.ASTStmt
}

func (*If) ASTStmt

func (i *If) ASTStmt() ast.Stmt

type Range

type Range struct {
	Key, Value astgen.ASTExpr
	Tok        token.Token
	Expr       astgen.ASTExpr
	Body       []astgen.ASTStmt
}

func (*Range) ASTStmt

func (r *Range) ASTStmt() ast.Stmt

type Return

type Return struct {
	Values []astgen.ASTExpr
}

func NewReturn

func NewReturn(values ...astgen.ASTExpr) *Return

func (*Return) ASTStmt

func (r *Return) ASTStmt() ast.Stmt

type Switch

type Switch struct {
	Init       astgen.ASTStmt
	Expression astgen.ASTExpr
	Cases      []CaseClause
}

func (*Switch) ASTStmt

func (s *Switch) ASTStmt() ast.Stmt

type TypeSwitch

type TypeSwitch struct {
	Init   astgen.ASTStmt
	Assign astgen.ASTStmt
	Cases  []CaseClause
}

func (*TypeSwitch) ASTStmt

func (t *TypeSwitch) ASTStmt() ast.Stmt

Jump to

Keyboard shortcuts

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