Documentation
¶
Index ¶
- type AST
- type ASTs
- type AndExpr
- type AnonFuncExpr
- type ArrayElement
- type ArrayElementBlock
- type ArrayLiteral
- type AssignOpStmt
- type AssignOperator
- type AssignStmt
- type BinaryExpr
- type BreakContinueEmitter
- type BreakStmt
- type Context
- func (c *Context) CurrentFunc() *Func
- func (c *Context) Emitter() *vm.Emitter
- func (c *Context) FindSymbol(symName string) symbol.Symbol
- func (c *Context) GetDep(packageName string) (pkg *vm.CompiledPackage, index int)
- func (c *Context) GetScope(typeMask scope.Type) scope.Scope
- func (c *Context) Imports() []*vm.CompiledPackage
- func (c *Context) IsInRepeatableScope() bool
- func (c *Context) IsLValue() bool
- func (c *Context) Len() int
- func (c *Context) Package() *Package
- func (c *Context) Parent() AST
- func (c *Context) Peek(n int) AST
- func (c *Context) RunPassChild(parent AST, child AST, pass Pass)
- type ContinueStmt
- type DeferStmt
- type ExecExpand
- type ExecHome
- type ExecWS
- type Expr
- type ExprStmt
- type Exprs
- type ForStmt
- type ForVar
- type Func
- func (f *Func) IdxFunc() int
- func (f *Func) IsIter() bool
- func (f *Func) IterNRet() int
- func (f *Func) NewCapture(sym symbol.Symbol) *symbol.CaptureSymbol
- func (f *Func) NewLocal() *symbol.LocalVarSymbol
- func (f *Func) NewParam() *symbol.ParamSymbol
- func (f *Func) RunPass(ctx *Context, pass Pass)
- func (f *Func) Scope() scope.Scope
- func (f *Func) SetIterNRet(nret int)
- type FuncCallExpr
- type FuncParam
- type FuncStmt
- type GraphPrinter
- type IfBlock
- type IfStmt
- type Import
- type IncDecOp
- type IncDecStmt
- type IndexExpr
- type LValue
- type LiteralExpr
- type MemberAccess
- type MetaAttrib
- type MetaParam
- type MetaParamInit
- type Nop
- type ObjectField
- type ObjectFieldBlock
- type ObjectLiteral
- type Operator
- type OrExpr
- type Package
- func (m *Package) AddGlobalParam(ctx *Context, name string, param *meta.Param, pos token.Pos) *symbol.GlobalVarSymbol
- func (p *Package) AddInitStmt(initStmt AST)
- func (p *Package) GetImports() []string
- func (m *Package) Metadata() *meta.Metadata
- func (m *Package) NewGlobal() *symbol.GlobalVarSymbol
- func (p *Package) RunPass(ctx *Context, pass Pass)
- func (p *Package) Scope() scope.Scope
- type Pass
- type PassRunner
- type PosImpl
- type PreResolvedReference
- type Printer
- type RegexLiteral
- type RepeatableScope
- type ReturnStmt
- type Scope
- type SimpleRef
- type SliceExpr
- type Stack
- type StmtBlock
- type TernaryExpr
- type ThrowStmt
- type TryCatchStmt
- type Type
- type UnaryExpr
- type UnaryOp
- type Unit
- type Value
- type VarDeclInit
- type VarDeclStmt
- type WhileStmt
- type YieldStmt
- type ZeroExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnonFuncExpr ¶
type AnonFuncExpr struct {
Func
}
func (*AnonFuncExpr) RunPass ¶
func (e *AnonFuncExpr) RunPass(ctx *Context, pass Pass)
type ArrayElement ¶
func (*ArrayElement) RunPass ¶
func (e *ArrayElement) RunPass(ctx *Context, pass Pass)
type ArrayElementBlock ¶
func (*ArrayElementBlock) RunPass ¶
func (b *ArrayElementBlock) RunPass(ctx *Context, pass Pass)
func (*ArrayElementBlock) Scope ¶
func (b *ArrayElementBlock) Scope() scope.Scope
type ArrayLiteral ¶
type ArrayLiteral struct {
PosImpl
Block *ArrayElementBlock
// contains filtered or unexported fields
}
func (*ArrayLiteral) RunPass ¶
func (a *ArrayLiteral) RunPass(ctx *Context, pass Pass)
func (*ArrayLiteral) Scope ¶
func (a *ArrayLiteral) Scope() scope.Scope
type AssignOpStmt ¶ added in v0.2.0
type AssignOpStmt struct {
PosImpl
Op Operator
LValue *LValue
RValue Expr
// contains filtered or unexported fields
}
func (*AssignOpStmt) RunPass ¶ added in v0.2.0
func (s *AssignOpStmt) RunPass(ctx *Context, pass Pass)
type AssignOperator ¶ added in v0.2.0
type AssignOperator int
type AssignStmt ¶
func (*AssignStmt) RunPass ¶
func (s *AssignStmt) RunPass(ctx *Context, pass Pass)
type BinaryExpr ¶
func (*BinaryExpr) RunPass ¶
func (e *BinaryExpr) RunPass(ctx *Context, pass Pass)
type BreakContinueEmitter ¶
type Context ¶
type Context struct {
Stack
*errlogger.ErrLoggerWrapper
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext( l *errlogger.ErrLoggerWrapper, deps []*vm.CompiledPackage, ) *Context
func (*Context) CurrentFunc ¶
func (*Context) GetDep ¶ added in v0.5.0
func (c *Context) GetDep(packageName string) (pkg *vm.CompiledPackage, index int)
func (*Context) Imports ¶ added in v0.5.0
func (c *Context) Imports() []*vm.CompiledPackage
func (*Context) IsInRepeatableScope ¶ added in v0.3.0
type ContinueStmt ¶
type ContinueStmt struct {
PosImpl
}
func (*ContinueStmt) RunPass ¶
func (s *ContinueStmt) RunPass(ctx *Context, pass Pass)
type DeferStmt ¶
type DeferStmt struct {
PosImpl
// contains filtered or unexported fields
}
func NewDeferStmt ¶
func NewDeferStmt(callExpr *FuncCallExpr) *DeferStmt
type ExecExpand ¶ added in v0.5.0
func (*ExecExpand) RunPass ¶ added in v0.5.0
func (e *ExecExpand) RunPass(ctx *Context, pass Pass)
type ExecHome ¶ added in v0.5.0
type ExecHome struct {
PosImpl
// contains filtered or unexported fields
}
type ForStmt ¶
type ForStmt struct {
PosImpl
ForVars ASTs
IterExpr Expr
Block AST
// contains filtered or unexported fields
}
func (*ForStmt) IsRepeatableScope ¶ added in v0.3.0
func (s *ForStmt) IsRepeatableScope()
type Func ¶
type Func struct {
PosImpl
Params ASTs
Block *StmtBlock
IsClosure bool
DebugName string
// contains filtered or unexported fields
}
func (*Func) NewCapture ¶
func (f *Func) NewCapture(sym symbol.Symbol) *symbol.CaptureSymbol
func (*Func) NewLocal ¶
func (f *Func) NewLocal() *symbol.LocalVarSymbol
func (*Func) NewParam ¶
func (f *Func) NewParam() *symbol.ParamSymbol
func (*Func) SetIterNRet ¶
type FuncCallExpr ¶
func (*FuncCallExpr) RunPass ¶
func (c *FuncCallExpr) RunPass(ctx *Context, pass Pass)
type GraphPrinter ¶
type GraphPrinter struct {
// contains filtered or unexported fields
}
func NewGraphPrinter ¶
func NewGraphPrinter(out io.Writer) *GraphPrinter
func (*GraphPrinter) PrintGraph ¶
func (p *GraphPrinter) PrintGraph(root Printer)
func (*GraphPrinter) PrintNode ¶
func (p *GraphPrinter) PrintNode(label string, children ...Printer)
type IncDecStmt ¶ added in v0.2.0
type IncDecStmt struct {
PosImpl
LValue *LValue
Op IncDecOp
// contains filtered or unexported fields
}
func (*IncDecStmt) RunPass ¶ added in v0.2.0
func (s *IncDecStmt) RunPass(ctx *Context, pass Pass)
type LiteralExpr ¶
func (*LiteralExpr) RunPass ¶
func (e *LiteralExpr) RunPass(ctx *Context, pass Pass)
type MemberAccess ¶
func (*MemberAccess) RunPass ¶
func (a *MemberAccess) RunPass(ctx *Context, pass Pass)
type MetaAttrib ¶
func (*MetaAttrib) RunPass ¶
func (a *MetaAttrib) RunPass(ctx *Context, pass Pass)
type MetaParam ¶
type MetaParamInit ¶ added in v0.3.0
type MetaParamInit struct {
PosImpl
Default Expr
GlobalSym *symbol.GlobalVarSymbol
}
func (*MetaParamInit) RunPass ¶ added in v0.3.0
func (p *MetaParamInit) RunPass(ctx *Context, pass Pass)
type ObjectField ¶
func (*ObjectField) RunPass ¶
func (s *ObjectField) RunPass(ctx *Context, pass Pass)
type ObjectFieldBlock ¶
func (*ObjectFieldBlock) RunPass ¶
func (b *ObjectFieldBlock) RunPass(ctx *Context, pass Pass)
func (*ObjectFieldBlock) Scope ¶
func (b *ObjectFieldBlock) Scope() scope.Scope
type ObjectLiteral ¶
type ObjectLiteral struct {
PosImpl
FieldBlock *ObjectFieldBlock
// contains filtered or unexported fields
}
func (*ObjectLiteral) RunPass ¶
func (s *ObjectLiteral) RunPass(ctx *Context, pass Pass)
func (*ObjectLiteral) Scope ¶
func (s *ObjectLiteral) Scope() scope.Scope
type Package ¶ added in v0.3.0
type Package struct {
PosImpl
IsMain bool
AutoImports ASTs
Units ASTs
// contains filtered or unexported fields
}
func (*Package) AddGlobalParam ¶ added in v0.5.0
func (*Package) AddInitStmt ¶ added in v0.3.0
func (*Package) GetImports ¶ added in v0.3.0
func (*Package) NewGlobal ¶ added in v0.5.0
func (m *Package) NewGlobal() *symbol.GlobalVarSymbol
type PassRunner ¶
type PreResolvedReference ¶ added in v0.5.0
type PreResolvedReference struct {
PosImpl
// TODO: for consistency, rename every `sym` everywhere to `symbol`.
Symbol symbol.Symbol
}
func (*PreResolvedReference) RunPass ¶ added in v0.5.0
func (r *PreResolvedReference) RunPass(ctx *Context, pass Pass)
type Printer ¶
type Printer interface {
Print(p *GraphPrinter)
}
type RegexLiteral ¶
func (*RegexLiteral) RunPass ¶
func (l *RegexLiteral) RunPass(ctx *Context, pass Pass)
type RepeatableScope ¶ added in v0.3.0
type RepeatableScope interface {
Scope
IsRepeatableScope()
}
type ReturnStmt ¶
func (*ReturnStmt) RunPass ¶
func (s *ReturnStmt) RunPass(ctx *Context, pass Pass)
type SimpleRef ¶
type TernaryExpr ¶
func (*TernaryExpr) RunPass ¶
func (e *TernaryExpr) RunPass(ctx *Context, pass Pass)
type TryCatchStmt ¶
type TryCatchStmt struct {
PosImpl
// contains filtered or unexported fields
}
func NewTryCatchStmt ¶
func NewTryCatchStmt( tryBlock AST, catchVar *token.Token, catchStmts AST, ) *TryCatchStmt
func (*TryCatchStmt) RunPass ¶
func (s *TryCatchStmt) RunPass(ctx *Context, pass Pass)
type Unit ¶ added in v0.2.0
type Unit struct {
PosImpl
Meta ASTs
Imports ASTs
Block ASTs
// contains filtered or unexported fields
}
func (*Unit) ConvertSimple ¶ added in v0.5.0
func (u *Unit) ConvertSimple()
type VarDeclInit ¶ added in v0.3.0
func (*VarDeclInit) RunPass ¶ added in v0.3.0
func (v *VarDeclInit) RunPass(ctx *Context, pass Pass)
type VarDeclStmt ¶
type VarDeclStmt struct {
PosImpl
Vars []token.Token
InitValues Exprs
// contains filtered or unexported fields
}
func (*VarDeclStmt) RunPass ¶
func (s *VarDeclStmt) RunPass(ctx *Context, pass Pass)
type WhileStmt ¶
type WhileStmt struct {
PosImpl
Predicate Expr
Block *StmtBlock
// contains filtered or unexported fields
}
func (*WhileStmt) IsRepeatableScope ¶ added in v0.3.0
func (s *WhileStmt) IsRepeatableScope()
Source Files
¶
- and_expr.go
- anon_func_expr.go
- array_element.go
- array_literal.go
- assign_op_stmt.go
- assign_stmt.go
- ast.go
- ast_ternary_expr.go
- binary_expr.go
- break_stmt.go
- context.go
- continue_stmt.go
- defer_stmt.go
- exec_expand.go
- exec_home.go
- exec_ws.go
- expr_stmt.go
- for_stmt.go
- func_base.go
- func_call_expr.go
- func_param.go
- func_stmt.go
- if_stmt.go
- import_stmt.go
- inc_dec_stmt.go
- index_expr.go
- literal_expr.go
- lvalue.go
- member_access.go
- meta_param.go
- nop.go
- object_field.go
- object_literal.go
- or_expr.go
- package.go
- pre_resolved_reference.go
- printer.go
- regex_literal.go
- return_stmt.go
- simple_ref.go
- slice_expr.go
- stack.go
- stmt_block.go
- throw_stmt.go
- try_catch_stmt.go
- unary_expr.go
- unit.go
- var_base.go
- var_decl_stmt.go
- while_stmt.go
- yield_stmt.go
- zero_expr.go
Click to show internal directories.
Click to hide internal directories.