Documentation
¶
Index ¶
- func CheckNoOptional(ctx *Context, target Expr) bool
- func PropagateOptional(target Expr)
- func RunPassChildren[T AST](c *Context, parent AST, children []T, pass Pass)
- func RunPassSlice[T AST](c *Context, asts []T, pass Pass)
- func WithPos[T AST](e AST, v T) T
- 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 FormatExpr
- type FormattedStringLiteral
- 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 IfSection
- type IfStmt
- type Import
- type IncDecOp
- type IncDecStmt
- type IndexExpr
- type LValue
- type LiteralExpr
- type Loop
- type MemberAccess
- type MetaAttrib
- type MetaParam
- type MetaParamInit
- type MultiValueExpr
- 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 PipeExpr
- type PosImpl
- type PreResolvedReference
- type Printer
- type RegexLiteral
- type Repeatable
- type ReturnStmt
- type RootExpr
- type RootExprType
- 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 Unwrapper
- type Value
- type VarDeclInit
- type VarDeclStmt
- type WhileStmt
- type YieldStmt
- type ZeroExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNoOptional ¶
func PropagateOptional ¶
func PropagateOptional(target Expr)
func RunPassSlice ¶
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 ¶
type ArrayElementBlock struct {
PosImpl
Elements []*ArrayElement
// contains filtered or unexported fields
}
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 ¶
type AssignOpStmt struct {
PosImpl
Op Operator
LValue *LValue
RValue Expr
// contains filtered or unexported fields
}
func (*AssignOpStmt) RunPass ¶
func (s *AssignOpStmt) RunPass(ctx *Context, pass Pass)
type AssignOperator ¶
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 ¶
func (c *Context) GetDep(packageName string) (pkg *vm.CompiledPackage, index int)
func (*Context) Imports ¶
func (c *Context) Imports() []*vm.CompiledPackage
func (*Context) IsInRepeatableScope ¶
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 ¶
func (*ExecExpand) RunPass ¶
func (e *ExecExpand) RunPass(ctx *Context, pass Pass)
type FormatExpr ¶
func (*FormatExpr) RunPass ¶
func (e *FormatExpr) RunPass(ctx *Context, pass Pass)
type FormattedStringLiteral ¶
func (*FormattedStringLiteral) RunPass ¶
func (e *FormattedStringLiteral) RunPass(ctx *Context, pass Pass)
type Func ¶
type Func struct {
PosImpl
Params []*FuncParam
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 ¶
type IncDecStmt struct {
PosImpl
LValue *LValue
Op IncDecOp
// contains filtered or unexported fields
}
func (*IncDecStmt) RunPass ¶
func (s *IncDecStmt) RunPass(ctx *Context, pass Pass)
type LiteralExpr ¶
func (*LiteralExpr) RunPass ¶
func (e *LiteralExpr) RunPass(ctx *Context, pass Pass)
type Loop ¶
type Loop struct {
PosImpl
Predicate Expr
Block AST
ContinueBlock AST
// contains filtered or unexported fields
}
func (*Loop) IsRepeatableScope ¶
func (l *Loop) IsRepeatableScope()
type MemberAccess ¶
type MemberAccess struct {
PosImpl
Target Expr
Member token.Token
Optional bool
ModuleMember symbol.Symbol
}
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 ¶
type MetaParamInit struct {
PosImpl
Default Expr
GlobalSym *symbol.GlobalVarSymbol
}
func (*MetaParamInit) RunPass ¶
func (p *MetaParamInit) RunPass(ctx *Context, pass Pass)
type MultiValueExpr ¶
type ObjectField ¶
func (*ObjectField) RunPass ¶
func (s *ObjectField) RunPass(ctx *Context, pass Pass)
type ObjectFieldBlock ¶
type ObjectFieldBlock struct {
PosImpl
Fields []*ObjectField
// contains filtered or unexported fields
}
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 ¶
type Package struct {
PosImpl
IsMain bool
AutoImports ASTs
Units ASTs
// contains filtered or unexported fields
}
func (*Package) AddGlobalParam ¶
func (*Package) AddInitStmt ¶
func (*Package) GetImports ¶
func (*Package) NewGlobal ¶
func (m *Package) NewGlobal() *symbol.GlobalVarSymbol
type PassRunner ¶
type PreResolvedReference ¶
type PreResolvedReference struct {
PosImpl
// TODO: for consistency, rename every `sym` everywhere to `symbol`.
Symbol symbol.Symbol
}
func (*PreResolvedReference) RunPass ¶
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 Repeatable ¶
func (*Repeatable) RunPass ¶
func (r *Repeatable) RunPass(ctx *Context, pass Pass)
type ReturnStmt ¶
func (*ReturnStmt) RunPass ¶
func (s *ReturnStmt) RunPass(ctx *Context, pass Pass)
type RootExpr ¶
type RootExprType ¶
type RootExprType int
const ( RootExprMemberAccess RootExprType = iota RootExprIndex )
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 ¶
type Unit struct {
PosImpl
Meta ASTs
Imports []*Import
Block ASTs
// contains filtered or unexported fields
}
func (*Unit) ConvertSimple ¶
func (u *Unit) ConvertSimple()
type VarDeclInit ¶
func (*VarDeclInit) RunPass ¶
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 ¶
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
- format_expr.go
- formatted_string_literal.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
- loop.go
- lvalue.go
- member_access.go
- meta_param.go
- nop.go
- object_field.go
- object_literal.go
- or_expr.go
- package.go
- pipe_expr.go
- pre_resolved_reference.go
- printer.go
- regex_literal.go
- repeable.go
- return_stmt.go
- root_expr.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.