Documentation
¶
Index ¶
- func SimpleScriptToPackage(u *Unit)
- 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) CurrentScope() symbol.Scope
- func (c *Context) Emitter() *vm.Emitter
- func (c *Context) FindSymbol(symName string) symbol.Symbol
- func (c *Context) IsInRepeatableScope() bool
- func (c *Context) Len() int
- func (c *Context) Main() *Root
- 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 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() symbol.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
- type Pass
- type PassRunner
- type PosImpl
- type Printer
- type RegexLiteral
- type RepeatableScope
- type ReturnStmt
- type Root
- func (m *Root) AddGlobalParam(ctx *Context, name string, param *meta.Param, pos token.Pos) *symbol.GlobalVarSymbol
- func (m *Root) AddUnit(module AST)
- func (m *Root) Metadata() *meta.Metadata
- func (m *Root) NewGlobal() *symbol.GlobalVarSymbol
- func (m *Root) RunPass(ctx *Context, pass Pass)
- func (m *Root) Scope() symbol.Scope
- type RootScope
- 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 ¶
func SimpleScriptToPackage ¶ added in v0.3.0
func SimpleScriptToPackage(u *Unit)
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() symbol.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() symbol.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, ) *Context
func (*Context) CurrentFunc ¶
func (*Context) CurrentScope ¶
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 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() symbol.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() symbol.Scope
type Package ¶ added in v0.3.0
func (*Package) AddInitStmt ¶ added in v0.3.0
func (*Package) GetImports ¶ added in v0.3.0
type PassRunner ¶
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 Root ¶ added in v0.3.0
type Root struct {
PosImpl
FuncRegistries []vm.ExportRegistry
Package Package
// contains filtered or unexported fields
}
func (*Root) AddGlobalParam ¶ added in v0.3.0
func (*Root) NewGlobal ¶ added in v0.3.0
func (m *Root) NewGlobal() *symbol.GlobalVarSymbol
type RootScope ¶ added in v0.3.0
type RootScope struct {
// contains filtered or unexported fields
}
func NewRootScope ¶ added in v0.3.0
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 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
- 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
- printer.go
- regex_literal.go
- return_stmt.go
- root.go
- root_scope.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.