stmt

package
v0.0.0-...-128b832 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncStmt

type AsyncStmt struct {
	CallExpr string
}

type Block

type Block struct {
	Stmts []IStmt
}

func (*Block) ToGoASTBlockStmt

func (b *Block) ToGoASTBlockStmt() (*goAST.BlockStmt, error)

func (*Block) ToGoASTNode

func (b *Block) ToGoASTNode() (goAST.Node, error)

func (*Block) ToGoASTStmt

func (b *Block) ToGoASTStmt() (goAST.Stmt, error)

type BreakStmt

type BreakStmt struct {
	Label string
	Layer int
}

type Expr

type Expr struct {
	Raw          string
	IsBreakStmt  bool
	IsRetrunStmt bool
	IsAsyncStmt  bool

	BreakStmt  *BreakStmt
	ReturnStmt *ReturnStmt
	AsyncStmt  *AsyncStmt
}

func (*Expr) AssertAsyncStmt

func (e *Expr) AssertAsyncStmt() *Expr

func (*Expr) AssertBreakStmt

func (e *Expr) AssertBreakStmt() *Expr

func (*Expr) AssertReturnStmt

func (e *Expr) AssertReturnStmt() *Expr

func (*Expr) AssertStmtType

func (e *Expr) AssertStmtType() *Expr

func (*Expr) ToGoASTExpr

func (e *Expr) ToGoASTExpr() (goAST.Expr, error)

func (*Expr) ToGoASTNode

func (e *Expr) ToGoASTNode() (goAST.Node, error)

func (*Expr) ToGoASTStmt

func (e *Expr) ToGoASTStmt() (goAST.Stmt, error)

type IStmt

type IStmt interface {
	lubanAST.INode
	ToGoASTStmt() (ast.Stmt, error)
}

type Loop

type Loop struct {
	Cond *Expr
	Body *Block
}

func (*Loop) ToGoASTNode

func (l *Loop) ToGoASTNode() (goAST.Node, error)

func (*Loop) ToGoASTStmt

func (l *Loop) ToGoASTStmt() (goAST.Stmt, error)

type Matcher

type Matcher struct {
	Targets []*Expr
	Body    *Block
}

func (*Matcher) ToGoASTNode

func (m *Matcher) ToGoASTNode() (goAST.Node, error)

func (*Matcher) ToGoASTStmt

func (m *Matcher) ToGoASTStmt() (goAST.Stmt, error)

type MultiBranch

type MultiBranch struct {
	Needle  *Expr
	Matches []*Matcher
}

func (*MultiBranch) ToGoASTNode

func (mb *MultiBranch) ToGoASTNode() (goAST.Node, error)

func (*MultiBranch) ToGoASTStmt

func (mb *MultiBranch) ToGoASTStmt() (goAST.Stmt, error)

type ReturnStmt

type ReturnStmt struct {
	Expr string
}

type TwoBranch

type TwoBranch struct {
	Cond      *Expr
	MatchBody *Block
	ElseBody  *Block
}

func (*TwoBranch) ToGoASTNode

func (tb *TwoBranch) ToGoASTNode() (goAST.Node, error)

func (*TwoBranch) ToGoASTStmt

func (tb *TwoBranch) ToGoASTStmt() (goAST.Stmt, error)

Jump to

Keyboard shortcuts

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