Documentation
¶
Index ¶
- Constants
- Variables
- func AssertCallable(t Token) error
- func FillAllScope(scope Scope)
- func FillBrowserAndWorkerCommonScope(scope Scope)
- func FillBrowserScope(scope Scope)
- func FillCoreScope(scope Scope)
- func FillGlobalScope(scope Scope)
- func FillNodeJSScope(scope Scope)
- func FillWorkerScope(scope Scope)
- func HashControl(fname string) string
- func IsAnyMember(t Expression) bool
- func IsAssign(t Expression) bool
- func IsCallable(t Token) bool
- func IsLiteral(expr Expression) bool
- func IsLiteralInt(t Expression) bool
- func IsLiteralTrue(t Expression) bool
- func IsMember(t Expression, name string) bool
- func IsNodeJSPackage(name string) bool
- func IsSimpleAssign(t Expression) bool
- func IsSimpleLT(t Expression) bool
- func IsSimplePostIncr(t Expression) bool
- func IsVarExpression(t Expression) bool
- func IsVoidReturn(t Token) bool
- func MergeContexts(ts ...Token) context.Context
- func ReserveMacroNames(scope Scope)
- func VarTypeToString(varType VarType) string
- func WriteGlobalHeaders(nl string, tab string) string
- type AddOp
- type Assign
- func (t *Assign) AddStatement(st Statement)
- func (t *Assign) Args() []Token
- func (t *Assign) Dump(indent string) string
- func (t *Assign) EvalExpression() (values.Value, error)
- func (t *Assign) EvalStatement() error
- func (t *Assign) GetLhsVarExpression() (*VarExpression, error)
- func (t *Assign) HasLhsVarExpression() bool
- func (t *Assign) HoistNames(scope Scope) error
- func (t *Assign) IsRegular() bool
- func (t *Assign) ResolveExpressionActivity(usage Usage) error
- func (t *Assign) ResolveExpressionNames(scope Scope) error
- func (t *Assign) ResolveStatementActivity(usage Usage) error
- func (t *Assign) ResolveStatementNames(scope Scope) error
- func (t *Assign) UniqueExpressionNames(ns Namespace) error
- func (t *Assign) UniqueStatementNames(ns Namespace) error
- func (t *Assign) UniversalExpressionNames(ns Namespace) error
- func (t *Assign) UniversalStatementNames(ns Namespace) error
- func (t *Assign) Walk(fn WalkFunc) error
- func (t *Assign) WriteExpression() string
- func (t *Assign) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Await
- func (t *Await) AddStatement(st Statement)
- func (t *Await) Args() []Token
- func (t *Await) Dump(indent string) string
- func (t *Await) EvalExpression() (values.Value, error)
- func (t *Await) EvalStatement() error
- func (t *Await) HoistNames(scope Scope) error
- func (t *Await) ResolveExpressionActivity(usage Usage) error
- func (t *Await) ResolveExpressionNames(scope Scope) error
- func (t *Await) ResolveStatementActivity(usage Usage) error
- func (t *Await) ResolveStatementNames(scope Scope) error
- func (t *Await) UniqueExpressionNames(ns Namespace) error
- func (t *Await) UniqueStatementNames(ns Namespace) error
- func (t *Await) UniversalExpressionNames(ns Namespace) error
- func (t *Await) UniversalStatementNames(ns Namespace) error
- func (t *Await) Walk(fn WalkFunc) error
- func (t *Await) WriteExpression() string
- func (t *Await) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type BinaryBitOp
- type BinaryOp
- func (t *BinaryOp) Args() []Token
- func (t *BinaryOp) Dump(indent string) string
- func (t *BinaryOp) ResolveExpressionActivity(usage Usage) error
- func (t *BinaryOp) ResolveExpressionNames(scope Scope) error
- func (t *BinaryOp) UniqueExpressionNames(ns Namespace) error
- func (t *BinaryOp) UniversalExpressionNames(ns Namespace) error
- func (t *BinaryOp) Walk(fn WalkFunc) error
- func (t *BinaryOp) WriteExpression() string
- type BitAndOp
- type BitNotOp
- type BitOrOp
- type BitXorOp
- type Block
- func (t *Block) AddStatement(statement Statement)
- func (t *Block) Dump(indent string) string
- func (t *Block) EvalStatement() error
- func (t *Block) HoistAndResolveStatementNames(scope Scope) error
- func (t *Block) HoistNames(scope Scope) error
- func (t *Block) NewScope(parent Scope) Scope
- func (t *Block) ResolveStatementActivity(usage Usage) error
- func (t *Block) ResolveStatementNames(scope Scope) error
- func (t *Block) UniqueStatementNames(ns Namespace) error
- func (t *Block) UniversalStatementNames(ns Namespace) error
- func (t *Block) Walk(fn WalkFunc) error
- type BlockScope
- type BranchScope
- type Break
- func (t *Break) AddStatement(st Statement)
- func (t *Break) Dump(indent string) string
- func (t *Break) EvalStatement() error
- func (t *Break) HoistNames(scope Scope) error
- func (t *Break) ResolveStatementActivity(usage Usage) error
- func (t *Break) ResolveStatementNames(scope Scope) error
- func (t *Break) UniqueStatementNames(ns Namespace) error
- func (t *Break) UniversalStatementNames(ns Namespace) error
- func (t *Break) Walk(fn WalkFunc) error
- func (t *Break) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Call
- func (t *Call) AddStatement(st Statement)
- func (t *Call) Args() []Expression
- func (t *Call) Dump(indent string) string
- func (t *Call) EvalExpression() (values.Value, error)
- func (t *Call) EvalStatement() error
- func (t *Call) HoistNames(scope Scope) error
- func (t *Call) Name() string
- func (t *Call) ResolveExpressionActivity(usage Usage) error
- func (t *Call) ResolveExpressionNames(scope Scope) error
- func (t *Call) ResolveStatementActivity(usage Usage) error
- func (t *Call) ResolveStatementNames(scope Scope) error
- func (t *Call) UniqueExpressionNames(ns Namespace) error
- func (t *Call) UniqueStatementNames(ns Namespace) error
- func (t *Call) UniversalExpressionNames(ns Namespace) error
- func (t *Call) UniversalStatementNames(ns Namespace) error
- func (t *Call) Walk(fn WalkFunc) error
- func (t *Call) WriteExpression() string
- func (t *Call) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type CaseScope
- type Class
- func (t *Class) AddConstructor(fn *Function) error
- func (t *Class) AddFunction(fn *Function) error
- func (t *Class) AddProperty(name *Word, expr *TypeExpression) error
- func (t *Class) AddStatement(st Statement)
- func (t *Class) Check(other_ values.Interface, ctx context.Context) error
- func (t *Class) Dump(indent string) string
- func (t *Class) EvalExpression() (values.Value, error)
- func (t *Class) EvalStatement() error
- func (t *Class) GetClassMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
- func (t *Class) GetClassValue() (*values.Class, error)
- func (t *Class) GetInstanceMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
- func (t *Class) GetInterfaces() ([]values.Interface, error)
- func (t *Class) GetParent() (values.Prototype, error)
- func (t *Class) GetPrototypes() ([]values.Prototype, error)
- func (t *Class) GetVariable() Variable
- func (t *Class) HoistNames(scope Scope) error
- func (t *Class) IsAbstract() bool
- func (t *Class) IsFinal() bool
- func (t *Class) IsRPC() bool
- func (t *Class) IsUniversal() bool
- func (t *Class) Name() string
- func (t *Class) Properties() (map[string]values.Value, error)
- func (t *Class) ResolveExpressionActivity(usage Usage) error
- func (t *Class) ResolveExpressionNames(scope Scope) error
- func (t *Class) ResolveStatementActivity(usage Usage) error
- func (t *Class) ResolveStatementNames(scope Scope) error
- func (t *Class) SetInstanceMember(key string, includePrivate bool, arg values.Value, ctx context.Context) error
- func (t *Class) UniqueExpressionNames(ns Namespace) error
- func (t *Class) UniqueStatementNames(ns Namespace) error
- func (t *Class) UniversalExpressionNames(ns Namespace) error
- func (t *Class) UniversalStatementNames(ns Namespace) error
- func (t *Class) Walk(fn WalkFunc) error
- func (t *Class) WriteExpression() string
- func (t *Class) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ClassFunction
- func (m *ClassFunction) Context() context.Context
- func (m *ClassFunction) Dump(indent string) string
- func (m *ClassFunction) Eval() error
- func (m *ClassFunction) GetThisVariable() Variable
- func (m *ClassFunction) GetValue(ctx context.Context) (values.Value, error)
- func (m *ClassFunction) IsUniversal() bool
- func (m *ClassFunction) Name() string
- func (m *ClassFunction) ResolveActivity(usage Usage) error
- func (m *ClassFunction) ResolveNames(scope Scope) error
- func (m *ClassFunction) Role() prototypes.FunctionRole
- func (m *ClassFunction) SetValue(v values.Value, ctx context.Context) error
- func (m *ClassFunction) UniqueNames(ns Namespace) error
- func (m *ClassFunction) UniversalNames(ns Namespace) error
- func (m *ClassFunction) Walk(fn WalkFunc) error
- func (m *ClassFunction) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ClassMember
- type ClassProperty
- func (p *ClassProperty) Context() context.Context
- func (p *ClassProperty) Dump(indent string) string
- func (p *ClassProperty) Eval() error
- func (p *ClassProperty) GetValue(ctx context.Context) (values.Value, error)
- func (p *ClassProperty) IsUniversal() bool
- func (p *ClassProperty) Name() string
- func (p *ClassProperty) ResolveActivity(usage Usage) error
- func (p *ClassProperty) ResolveNames(scope Scope) error
- func (p *ClassProperty) Role() prototypes.FunctionRole
- func (p *ClassProperty) SetValue(v values.Value, ctx context.Context) error
- func (p *ClassProperty) UniqueNames(ns Namespace) error
- func (p *ClassProperty) UniversalNames(ns Namespace) error
- func (p *ClassProperty) Walk(fn WalkFunc) error
- func (p *ClassProperty) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ClassScope
- type Continue
- func (t *Continue) AddStatement(st Statement)
- func (t *Continue) Dump(indent string) string
- func (t *Continue) EvalStatement() error
- func (t *Continue) HoistNames(scope Scope) error
- func (t *Continue) ResolveStatementActivity(usage Usage) error
- func (t *Continue) ResolveStatementNames(scope Scope) error
- func (t *Continue) UniqueStatementNames(ns Namespace) error
- func (t *Continue) UniversalStatementNames(ns Namespace) error
- func (t *Continue) Walk(fn WalkFunc) error
- func (t *Continue) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type DeleteOp
- func (t *DeleteOp) EvalExpression() (values.Value, error)
- func (t *DeleteOp) EvalStatement() error
- func (t *DeleteOp) ResolveStatementActivity(usage Usage) error
- func (t *DeleteOp) ResolveStatementNames(scope Scope) error
- func (t *DeleteOp) UniqueStatementNames(ns Namespace) error
- func (t *DeleteOp) UniversalStatementNames(ns Namespace) error
- func (t *DeleteOp) Walk(fn WalkFunc) error
- func (t *DeleteOp) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type DivOp
- type DontKeepSignRightShiftOp
- type Enum
- func (t *Enum) AddStatement(st Statement)
- func (t *Enum) Check(other_ values.Interface, ctx context.Context) error
- func (t *Enum) Dump(indent string) string
- func (t *Enum) EvalStatement() error
- func (t *Enum) GetClassMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
- func (t *Enum) GetClassValue() (*values.Class, error)
- func (t *Enum) GetEnumValue() (*values.Enum, error)
- func (t *Enum) GetInstanceMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
- func (t *Enum) GetInterfaces() ([]values.Interface, error)
- func (t *Enum) GetParent() (values.Prototype, error)
- func (t *Enum) GetPrototypes() ([]values.Prototype, error)
- func (t *Enum) GetVariable() Variable
- func (t *Enum) HoistNames(scope Scope) error
- func (t *Enum) IsAbstract() bool
- func (t *Enum) IsFinal() bool
- func (t *Enum) IsRPC() bool
- func (t *Enum) IsUniversal() bool
- func (t *Enum) Name() string
- func (t *Enum) ResolveStatementActivity(usage Usage) error
- func (t *Enum) ResolveStatementNames(scope Scope) error
- func (t *Enum) SetInstanceMember(key string, includePrivate bool, arg values.Value, ctx context.Context) error
- func (t *Enum) UniqueStatementNames(ns Namespace) error
- func (t *Enum) UniversalStatementNames(ns Namespace) error
- func (t *Enum) Walk(fn WalkFunc) error
- func (t *Enum) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type EnumMember
- type EqCompareOp
- type EqOp
- type Export
- func (t *Export) AddStatement(st Statement)
- func (t *Export) Dump(indent string) string
- func (t *Export) EvalStatement() error
- func (t *Export) HoistNames(scope Scope) error
- func (t *Export) ResolveStatementActivity(usage Usage) error
- func (t *Export) ResolveStatementNames(scope Scope) error
- func (t *Export) UniqueStatementNames(ns Namespace) error
- func (t *Export) UniversalStatementNames(ns Namespace) error
- func (t *Export) Walk(fn WalkFunc) error
- func (t *Export) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ExportedVariable
- type Expression
- type FillPackageFunction
- type For
- func (t *For) Dump(indent string) string
- func (t *For) EvalStatement() error
- func (t *For) HoistNames(scope Scope) error
- func (t *For) ResolveStatementActivity(usage Usage) error
- func (t *For) ResolveStatementNames(scope Scope) error
- func (t *For) UniqueStatementNames(ns Namespace) error
- func (t *For) UniversalStatementNames(ns Namespace) error
- func (t *For) Walk(fn WalkFunc) error
- func (t *For) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ForBlock
- type ForIn
- type ForInOf
- func (t *ForInOf) HoistNames(scope Scope) error
- func (t *ForInOf) ResolveStatementActivity(usage Usage) error
- func (t *ForInOf) ResolveStatementNames(scope Scope) error
- func (t *ForInOf) UniqueStatementNames(ns Namespace) error
- func (t *ForInOf) UniversalStatementNames(ns Namespace) error
- func (t *ForInOf) Walk(fn WalkFunc) error
- type ForOf
- type Function
- func (t *Function) Dump(indent string) string
- func (t *Function) EvalExpression() (values.Value, error)
- func (t *Function) EvalStatement() error
- func (t *Function) GetArgValues() ([]values.Value, error)
- func (t *Function) GetFunctionValue() (*values.Function, error)
- func (t *Function) GetReturnValue() (values.Value, error)
- func (t *Function) GetThisVariable() Variable
- func (t *Function) GetVariable() Variable
- func (t *Function) HoistNames(scope Scope) error
- func (t *Function) Interface() *FunctionInterface
- func (t *Function) IsAsync() bool
- func (t *Function) IsVoid() bool
- func (t *Function) Length() int
- func (t *Function) Name() string
- func (t *Function) NewScope(parent Scope) *FunctionScope
- func (t *Function) RegisterReturn(ret *Return)
- func (t *Function) ResolveExpressionActivity(usage Usage) error
- func (t *Function) ResolveExpressionNames(outer Scope) error
- func (t *Function) ResolveStatementActivity(usage Usage) error
- func (t *Function) ResolveStatementNames(scope Scope) error
- func (t *Function) Role() prototypes.FunctionRole
- func (t *Function) UniqueExpressionNames(ns Namespace) error
- func (t *Function) UniqueStatementNames(ns Namespace) error
- func (t *Function) UniversalExpressionNames(ns Namespace) error
- func (t *Function) UniversalStatementNames(ns Namespace) error
- func (t *Function) Walk(fn WalkFunc) error
- func (t *Function) WriteExpression() string
- func (t *Function) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type FunctionArgument
- func (fa *FunctionArgument) AssertNoDefault() error
- func (fa *FunctionArgument) Dump(indent string) string
- func (fa *FunctionArgument) Eval() error
- func (fa *FunctionArgument) GetValue() (values.Value, error)
- func (fa *FunctionArgument) GetVariable() Variable
- func (fa *FunctionArgument) HasDefault() bool
- func (fa *FunctionArgument) Name() string
- func (fa *FunctionArgument) ResolveInterfaceNames(scope Scope) error
- func (fa *FunctionArgument) ResolveNames(scope Scope) error
- func (fa *FunctionArgument) TypeName() string
- func (fa *FunctionArgument) UniqueNames(ns Namespace) error
- func (fa *FunctionArgument) UniversalNames(ns Namespace) error
- func (fa *FunctionArgument) Walk(fn WalkFunc) error
- func (fa *FunctionArgument) Write() string
- type FunctionInterface
- func (fi *FunctionInterface) AppendArg(arg *FunctionArgument)
- func (fi *FunctionInterface) AssertNoDefaults() error
- func (fi *FunctionInterface) CheckRPC() error
- func (fi *FunctionInterface) Context() context.Context
- func (fi *FunctionInterface) Dump() string
- func (fi *FunctionInterface) Eval() error
- func (fi *FunctionInterface) GetArgValues() ([]values.Value, error)
- func (fi *FunctionInterface) GetFunctionValue() (*values.Function, error)
- func (fi *FunctionInterface) GetReturnValue() (values.Value, error)
- func (fi *FunctionInterface) GetVariable() Variable
- func (fi *FunctionInterface) IsVoid() bool
- func (fi *FunctionInterface) Length() int
- func (fi *FunctionInterface) Name() string
- func (fi *FunctionInterface) ResolveNames(scope Scope) error
- func (fi *FunctionInterface) Role() prototypes.FunctionRole
- func (fi *FunctionInterface) SetReturnType(ret *TypeExpression)
- func (fi *FunctionInterface) SetRole(r prototypes.FunctionRole)
- func (fi *FunctionInterface) UniqueNames(ns Namespace) error
- func (fi *FunctionInterface) UniversalNames(ns Namespace) error
- func (fi *FunctionInterface) Walk(fn WalkFunc) error
- func (fi *FunctionInterface) Write() string
- type FunctionScope
- type GEOp
- type GTOp
- type GlobalScope
- type GlobalScopeData
- type If
- func (t *If) AddCondition(expr Expression) error
- func (t *If) AddElse() error
- func (t *If) AddStatement(statement Statement)
- func (t *If) Dump(indent string) string
- func (t *If) EvalStatement() error
- func (t *If) HoistNames(scope Scope) error
- func (t *If) ResolveStatementActivity(usage Usage) error
- func (t *If) ResolveStatementNames(scope Scope) error
- func (t *If) UniqueStatementNames(ns Namespace) error
- func (t *If) UniversalStatementNames(ns Namespace) error
- func (t *If) Walk(fn WalkFunc) error
- func (t *If) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type IfElseOp
- type Import
- func (t *Import) AddStatement(st Statement)
- func (t *Import) Dump(indent string) string
- func (t *Import) EvalStatement() error
- func (t *Import) HoistNames(scope Scope) error
- func (t *Import) ResolveStatementActivity(usage Usage) error
- func (t *Import) ResolveStatementNames(scope Scope) error
- func (t *Import) UniqueStatementNames(ns Namespace) error
- func (t *Import) UniversalStatementNames(ns Namespace) error
- func (t *Import) Walk(fn WalkFunc) error
- func (t *Import) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ImportedVariable
- func (iv *ImportedVariable) AbsPath() string
- func (iv *ImportedVariable) Context() context.Context
- func (iv *ImportedVariable) GetVariable() Variable
- func (iv *ImportedVariable) PathContext() context.Context
- func (iv *ImportedVariable) PathLiteral() *LiteralString
- func (iv *ImportedVariable) Walk(fn WalkFunc) error
- type InOp
- type Index
- func (t *Index) Dump(indent string) string
- func (t *Index) EvalExpression() (values.Value, error)
- func (t *Index) EvalSet(rhsValue values.Value, ctx context.Context) error
- func (t *Index) ResolveExpressionActivity(usage Usage) error
- func (t *Index) ResolveExpressionNames(scope Scope) error
- func (t *Index) UniqueExpressionNames(ns Namespace) error
- func (t *Index) UniversalExpressionNames(ns Namespace) error
- func (t *Index) Walk(fn WalkFunc) error
- func (t *Index) WriteExpression() string
- type InstanceOf
- type Interface
- func (t *Interface) AddMember(member *FunctionInterface) error
- func (t *Interface) AddStatement(st Statement)
- func (t *Interface) Check(other_ values.Interface, ctx context.Context) error
- func (t *Interface) Dump(indent string) string
- func (t *Interface) EvalStatement() error
- func (t *Interface) GetInstanceMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
- func (t *Interface) GetInterfaces() ([]values.Interface, error)
- func (t *Interface) GetPrototypes() ([]values.Prototype, error)
- func (t *Interface) GetVariable() Variable
- func (t *Interface) HoistNames(scope Scope) error
- func (t *Interface) IsRPC() bool
- func (t *Interface) IsUniversal() bool
- func (t *Interface) Name() string
- func (t *Interface) ResolveStatementActivity(usage Usage) error
- func (t *Interface) ResolveStatementNames(scope Scope) error
- func (t *Interface) SetInstanceMember(key string, includePrivate bool, arg values.Value, ctx context.Context) error
- func (t *Interface) UniqueStatementNames(ns Namespace) error
- func (t *Interface) UniversalStatementNames(ns Namespace) error
- func (t *Interface) Walk(fn WalkFunc) error
- func (t *Interface) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type KeepSignRightShiftOp
- type LEOp
- type LTOp
- type LeftShiftOp
- type LiteralArray
- func (t *LiteralArray) Dump(indent string) string
- func (t *LiteralArray) EvalExpression() (values.Value, error)
- func (t *LiteralArray) ResolveExpressionActivity(usage Usage) error
- func (t *LiteralArray) ResolveExpressionNames(scope Scope) error
- func (t *LiteralArray) UniqueExpressionNames(ns Namespace) error
- func (t *LiteralArray) UniversalExpressionNames(ns Namespace) error
- func (t *LiteralArray) Walk(fn WalkFunc) error
- func (t *LiteralArray) WriteExpression() string
- type LiteralBoolean
- type LiteralData
- type LiteralFloat
- type LiteralInt
- type LiteralNull
- type LiteralObject
- func (t *LiteralObject) Dump(indent string) string
- func (t *LiteralObject) EvalExpression() (values.Value, error)
- func (t *LiteralObject) ResolveExpressionActivity(usage Usage) error
- func (t *LiteralObject) ResolveExpressionNames(scope Scope) error
- func (t *LiteralObject) UniqueExpressionNames(ns Namespace) error
- func (t *LiteralObject) UniversalExpressionNames(ns Namespace) error
- func (t *LiteralObject) Walk(fn WalkFunc) error
- func (t *LiteralObject) WriteExpression() string
- type LiteralObjectMember
- type LiteralString
- func (t *LiteralString) Dump(indent string) string
- func (t *LiteralString) EvalExpression() (values.Value, error)
- func (t *LiteralString) InnerContext() context.Context
- func (t *LiteralString) Value() string
- func (t *LiteralString) Walk(fn WalkFunc) error
- func (t *LiteralString) WriteExpression() string
- type LogicalAndOp
- type LogicalBinaryOp
- type LogicalNotOp
- type LogicalOrOp
- type LoopScope
- type Member
- func (t *Member) Args() []Token
- func (t *Member) Dump(indent string) string
- func (t *Member) EvalExpression() (values.Value, error)
- func (t *Member) EvalSet(rhsValue values.Value, ctx context.Context) error
- func (t *Member) GetPackageMember() (Variable, error)
- func (t *Member) IsBuiltinPackage() bool
- func (t *Member) KeyContext() context.Context
- func (t *Member) ObjectContext() context.Context
- func (t *Member) ObjectNameAndKey() (string, string)
- func (t *Member) PackageName() string
- func (t *Member) PackagePath() string
- func (t *Member) ResolveExpressionActivity(usage Usage) error
- func (t *Member) ResolveExpressionNames(scope Scope) error
- func (t *Member) ToTypeExpression() (*TypeExpression, error)
- func (t *Member) UniqueExpressionNames(ns Namespace) error
- func (t *Member) UniversalExpressionNames(ns Namespace) error
- func (t *Member) Walk(fn WalkFunc) error
- func (t *Member) WriteExpression() string
- type Module
- type ModuleData
- func (m *ModuleData) AddAggregateExport(newName, oldName string, pathLiteral *LiteralString, lang files.Lang, ...) error
- func (m *ModuleData) AddExportedName(outerName, innerName string, v Variable, ctx context.Context) error
- func (m *ModuleData) AddImportedName(newName, oldName string, pathLiteral *LiteralString, lang files.Lang, ...) error
- func (m *ModuleData) Dependencies() []files.PathLang
- func (m *ModuleData) Dump() string
- func (m *ModuleData) EvalTypes() error
- func (m *ModuleData) GetExportedVariable(gs GlobalScope, name string, nameCtx context.Context) (Variable, error)
- func (m *ModuleData) Parent() Scope
- func (m *ModuleData) ResolveActivity(usage Usage) error
- func (m *ModuleData) ResolveNames(gs GlobalScope) error
- func (m *ModuleData) UniqueEntryPointNames(ns Namespace) error
- func (m *ModuleData) UniqueNames(ns Namespace) error
- func (m *ModuleData) UniversalNames(ns Namespace) error
- func (m *ModuleData) Walk(fn WalkFunc) error
- func (m *ModuleData) Write(usage Usage, nl string, tab string) (string, error)
- type ModuleScope
- type MulOp
- type NEOp
- type Namespace
- type NamespaceData
- func (ns *NamespaceData) ArgName(v Variable)
- func (ns *NamespaceData) ClassName(v Variable) error
- func (ns *NamespaceData) CurrentFunctionNamespace() Namespace
- func (ns *NamespaceData) FunctionName(v Variable)
- func (ns *NamespaceData) HasName(new string) bool
- func (ns *NamespaceData) HasVar(v Variable) bool
- func (ns *NamespaceData) LetName(v Variable)
- func (ns *NamespaceData) LibName(v Variable, name string) error
- func (ns *NamespaceData) NewBlockNamespace() Namespace
- func (ns *NamespaceData) NewFunctionNamespace() Namespace
- func (ns *NamespaceData) OriginalName(v Variable, name string) error
- func (ns *NamespaceData) UniversalName(v Variable, name string) error
- func (ns *NamespaceData) VarName(v Variable)
- type NegOp
- type NewOp
- type NodeJSImport
- func (m *NodeJSImport) AddStatement(st Statement)
- func (m *NodeJSImport) Dump(indent string) string
- func (m *NodeJSImport) EvalStatement() error
- func (m *NodeJSImport) HoistNames(scope Scope) error
- func (m *NodeJSImport) ResolveStatementActivity(usage Usage) error
- func (m *NodeJSImport) ResolveStatementNames(scope Scope) error
- func (m *NodeJSImport) UniqueStatementNames(ns Namespace) error
- func (m *NodeJSImport) UniversalStatementNames(ns Namespace) error
- func (m *NodeJSImport) Walk(fn WalkFunc) error
- func (m *NodeJSImport) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Op
- func NewBinaryOp(op string, a Expression, b Expression, ctx context.Context) (Op, error)
- func NewPostUnaryOp(op string, a Expression, ctx context.Context) (Op, error)
- func NewPreUnaryOp(op string, a Expression, ctx context.Context) (Op, error)
- func NewTernaryOp(op string, a Expression, b Expression, c Expression, ctx context.Context) (Op, error)
- type OrderCompareOp
- type Package
- func (t *Package) AddPrototype(proto values.Prototype)
- func (t *Package) AddValue(memberName string, v values.Value)
- func (t *Package) Constant() bool
- func (t *Package) Dump(indent string) string
- func (t *Package) GetObject() interface{}
- func (t *Package) GetValue() values.Value
- func (t *Package) IsBuiltin() bool
- func (t *Package) Name() string
- func (t *Package) Path() string
- func (t *Package) Rename(newName string)
- func (t *Package) SetConstant()
- func (t *Package) SetObject(ptr interface{})
- func (t *Package) SetValue(v values.Value)
- type Parens
- func (t *Parens) CollectTypeGuards(c map[Variable]values.Interface) (bool, error)
- func (t *Parens) Dump(indent string) string
- func (t *Parens) EvalExpression() (values.Value, error)
- func (t *Parens) ResolveExpressionActivity(usage Usage) error
- func (t *Parens) ResolveExpressionNames(scope Scope) error
- func (t *Parens) UniqueExpressionNames(ns Namespace) error
- func (t *Parens) UniversalExpressionNames(ns Namespace) error
- func (t *Parens) Walk(fn WalkFunc) error
- func (t *Parens) WriteExpression() string
- type PosOp
- type PostDecrOp
- func (t *PostDecrOp) EvalExpression() (values.Value, error)
- func (t *PostDecrOp) EvalStatement() error
- func (t *PostDecrOp) ResolveStatementActivity(usage Usage) error
- func (t *PostDecrOp) ResolveStatementNames(scope Scope) error
- func (t *PostDecrOp) UniqueStatementNames(ns Namespace) error
- func (t *PostDecrOp) UniversalStatementNames(ns Namespace) error
- func (t *PostDecrOp) Walk(fn WalkFunc) error
- func (t *PostDecrOp) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type PostIncrOp
- func (t *PostIncrOp) EvalExpression() (values.Value, error)
- func (t *PostIncrOp) EvalStatement() error
- func (t *PostIncrOp) ResolveStatementActivity(usage Usage) error
- func (t *PostIncrOp) ResolveStatementNames(scope Scope) error
- func (t *PostIncrOp) UniqueStatementNames(ns Namespace) error
- func (t *PostIncrOp) UniversalStatementNames(ns Namespace) error
- func (t *PostIncrOp) Walk(fn WalkFunc) error
- func (t *PostIncrOp) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type PostUnaryOp
- type PowOp
- type PreDecrOp
- type PreIncrOp
- type PreUnaryOp
- type RemainderOp
- type Return
- func (t *Return) AddStatement(st Statement)
- func (t *Return) Dump(indent string) string
- func (t *Return) EvalStatement() error
- func (t *Return) HoistNames(scope Scope) error
- func (t *Return) ResolveStatementActivity(usage Usage) error
- func (t *Return) ResolveStatementNames(scope Scope) error
- func (t *Return) UniqueStatementNames(ns Namespace) error
- func (t *Return) UniversalStatementNames(ns Namespace) error
- func (t *Return) Walk(fn WalkFunc) error
- func (t *Return) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Scope
- type ScopeData
- func (s *ScopeData) FriendlyPrototypes() []values.Prototype
- func (s *ScopeData) GetFunction() *Function
- func (s *ScopeData) GetVariable(name string) (Variable, error)
- func (s *ScopeData) HasVariable(name string) bool
- func (s *ScopeData) IsAsync() bool
- func (s *ScopeData) IsBreakable() bool
- func (s *ScopeData) IsContinueable() bool
- func (s *ScopeData) Parent() Scope
- func (s *ScopeData) SetVariable(name string, v Variable) error
- type ShiftOp
- type SpecialNumber
- func (t *SpecialNumber) Dump(indent string) string
- func (t *SpecialNumber) EvalExpression() (values.Value, error)
- func (t *SpecialNumber) ResolveExpressionActivity(usage Usage) error
- func (t *SpecialNumber) ResolveExpressionNames(scope Scope) error
- func (t *SpecialNumber) UniqueExpressionNames(ns Namespace) error
- func (t *SpecialNumber) UniversalExpressionNames(ns Namespace) error
- func (t *SpecialNumber) Value() string
- func (t *SpecialNumber) Walk(fn WalkFunc) error
- func (t *SpecialNumber) WriteExpression() string
- type Statement
- type StrictEqOp
- type StrictNEOp
- type SubOp
- type SubScope
- type Switch
- func (t *Switch) AddCase(clause Expression) error
- func (t *Switch) AddDefault(ctx context.Context) error
- func (t *Switch) AddStatement(statement Statement)
- func (t *Switch) ConvertToIf() *If
- func (t *Switch) Dump(indent string) string
- func (t *Switch) EvalStatement() error
- func (t *Switch) HoistNames(scope Scope) error
- func (t *Switch) ResolveStatementActivity(usage Usage) error
- func (t *Switch) ResolveStatementNames(scope Scope) error
- func (t *Switch) UniqueStatementNames(ns Namespace) error
- func (t *Switch) UniversalStatementNames(ns Namespace) error
- func (t *Switch) Walk(fn WalkFunc) error
- func (t *Switch) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type TemplateString
- func (t *TemplateString) Dump(indent string) string
- func (t *TemplateString) EvalExpression() (values.Value, error)
- func (t *TemplateString) ResolveExpressionActivity(usage Usage) error
- func (t *TemplateString) ResolveExpressionNames(scope Scope) error
- func (t *TemplateString) UniqueExpressionNames(ns Namespace) error
- func (t *TemplateString) UniversalExpressionNames(ns Namespace) error
- func (t *TemplateString) Walk(fn WalkFunc) error
- func (t *TemplateString) WriteExpression() string
- type TernaryOp
- func (t *TernaryOp) Args() []Token
- func (t *TernaryOp) Dump(indent string) string
- func (t *TernaryOp) ResolveExpressionActivity(usage Usage) error
- func (t *TernaryOp) ResolveExpressionNames(scope Scope) error
- func (t *TernaryOp) UniqueExpressionNames(ns Namespace) error
- func (t *TernaryOp) UniversalExpressionNames(ns Namespace) error
- func (t *TernaryOp) Walk(fn WalkFunc) error
- func (t *TernaryOp) WriteExpression() string
- type Throw
- func (t *Throw) AddStatement(st Statement)
- func (t *Throw) Dump(indent string) string
- func (t *Throw) EvalStatement() error
- func (t *Throw) HoistNames(scope Scope) error
- func (t *Throw) ResolveStatementActivity(usage Usage) error
- func (t *Throw) ResolveStatementNames(scope Scope) error
- func (t *Throw) UniqueStatementNames(ns Namespace) error
- func (t *Throw) UniversalStatementNames(ns Namespace) error
- func (t *Throw) Walk(fn WalkFunc) error
- func (t *Throw) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Token
- type TokenData
- type TryCatch
- func (t *TryCatch) AddCatch(arg *FunctionArgument) error
- func (t *TryCatch) AddFinally() error
- func (t *TryCatch) AddStatement(statement Statement)
- func (t *TryCatch) Dump(indent string) string
- func (t *TryCatch) EvalStatement() error
- func (t *TryCatch) HoistNames(scope Scope) error
- func (t *TryCatch) ResolveStatementActivity(usage Usage) error
- func (t *TryCatch) ResolveStatementNames(scope Scope) error
- func (t *TryCatch) UniqueStatementNames(ns Namespace) error
- func (t *TryCatch) UniversalStatementNames(ns Namespace) error
- func (t *TryCatch) Walk(fn WalkFunc) error
- func (t *TryCatch) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type TypeExpression
- type TypeExpressionMember
- type TypeGuard
- type TypeOfOp
- type UnaryOp
- func (t *UnaryOp) Args() []Token
- func (t *UnaryOp) ResolveExpressionActivity(usage Usage) error
- func (t *UnaryOp) ResolveExpressionNames(scope Scope) error
- func (t *UnaryOp) UniqueExpressionNames(ns Namespace) error
- func (t *UnaryOp) UniversalExpressionNames(ns Namespace) error
- func (t *UnaryOp) Walk(fn WalkFunc) error
- type Usage
- type UsageData
- type UsageState
- type VarExpression
- func (t *VarExpression) Dump(indent string) string
- func (t *VarExpression) EvalExpression() (values.Value, error)
- func (t *VarExpression) EvalSet(v values.Value, ctx context.Context) error
- func (t *VarExpression) GetInterface() values.Interface
- func (t *VarExpression) GetPrototype() values.Prototype
- func (t *VarExpression) GetVariable() Variable
- func (t *VarExpression) Name() string
- func (t *VarExpression) NonPackageContext() context.Context
- func (t *VarExpression) PackageContext() context.Context
- func (t *VarExpression) PackagePath() string
- func (t *VarExpression) RefersToPackage(absPath string) bool
- func (t *VarExpression) ResolveExpressionActivity(usage Usage) error
- func (t *VarExpression) ResolveExpressionNames(scope Scope) error
- func (t *VarExpression) ToTypeExpression() (*TypeExpression, error)
- func (t *VarExpression) UniqueExpressionNames(ns Namespace) error
- func (t *VarExpression) UniversalExpressionNames(ns Namespace) error
- func (t *VarExpression) Walk(fn WalkFunc) error
- func (t *VarExpression) WriteExpression() string
- type VarStatement
- func (t *VarStatement) AddStatement(st Statement)
- func (t *VarStatement) Dump(indent string) string
- func (t *VarStatement) EvalStatement() error
- func (t *VarStatement) GetVariables() map[string]Variable
- func (t *VarStatement) HoistNames(scope Scope) error
- func (t *VarStatement) ResolveStatementActivity(usage Usage) error
- func (t *VarStatement) ResolveStatementNames(scope Scope) error
- func (t *VarStatement) UniqueStatementNames(ns Namespace) error
- func (t *VarStatement) UniversalStatementNames(ns Namespace) error
- func (t *VarStatement) Walk(fn WalkFunc) error
- func (t *VarStatement) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type VarType
- type Variable
- type VariableData
- func (t *VariableData) Constant() bool
- func (t *VariableData) Dump(indent string) string
- func (t *VariableData) GetObject() interface{}
- func (t *VariableData) GetValue() values.Value
- func (t *VariableData) Name() string
- func (t *VariableData) Rename(newName string)
- func (t *VariableData) SetConstant()
- func (t *VariableData) SetObject(ptr interface{})
- func (t *VariableData) SetValue(v values.Value)
- type Void
- func (t *Void) AddStatement(st Statement)
- func (t *Void) Dump(indent string) string
- func (t *Void) EvalStatement() error
- func (t *Void) HoistNames(scope Scope) error
- func (t *Void) ResolveStatementActivity(usage Usage) error
- func (t *Void) ResolveStatementNames(scope Scope) error
- func (t *Void) UniqueStatementNames(ns Namespace) error
- func (t *Void) UniversalStatementNames(ns Namespace) error
- func (t *Void) Walk(fn WalkFunc) error
- func (t *Void) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type WalkFunc
- type While
- func (t *While) Dump(indent string) string
- func (t *While) EvalStatement() error
- func (t *While) HoistNames(scope Scope) error
- func (t *While) ResolveStatementActivity(usage Usage) error
- func (t *While) ResolveStatementNames(scope Scope) error
- func (t *While) UniqueStatementNames(ns Namespace) error
- func (t *While) UniversalStatementNames(ns Namespace) error
- func (t *While) Walk(fn WalkFunc) error
- func (t *While) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Word
Constants ¶
const (
CAST_MACRO_NAME = "cast"
)
const NewRPCClientMemberName = "newRPCClient"
Variables ¶
var ActivateMacroHeaders func(name string) = nil
var TARGET = "nodejs"
var (
VERBOSITY = 0
)
Functions ¶
func AssertCallable ¶
func FillAllScope ¶
func FillAllScope(scope Scope)
func FillBrowserAndWorkerCommonScope ¶
func FillBrowserAndWorkerCommonScope(scope Scope)
func FillBrowserScope ¶
func FillBrowserScope(scope Scope)
func FillGlobalScope ¶
func FillGlobalScope(scope Scope)
func FillNodeJSScope ¶
func FillNodeJSScope(scope Scope)
func FillWorkerScope ¶
func FillWorkerScope(scope Scope)
func HashControl ¶
func IsAnyMember ¶
func IsAnyMember(t Expression) bool
func IsAssign ¶
func IsAssign(t Expression) bool
func IsLiteral ¶
func IsLiteral(expr Expression) bool
it is easier to do this via assertion than to add a method to each expression
func IsLiteralInt ¶
func IsLiteralInt(t Expression) bool
func IsLiteralTrue ¶
func IsLiteralTrue(t Expression) bool
func IsMember ¶
func IsMember(t Expression, name string) bool
func IsNodeJSPackage ¶
func IsSimpleAssign ¶
func IsSimpleAssign(t Expression) bool
func IsSimpleLT ¶
func IsSimpleLT(t Expression) bool
func IsSimplePostIncr ¶
func IsSimplePostIncr(t Expression) bool
func IsVarExpression ¶
func IsVarExpression(t Expression) bool
func IsVoidReturn ¶
func MergeContexts ¶
func ReserveMacroNames ¶
func ReserveMacroNames(scope Scope)
func VarTypeToString ¶
func WriteGlobalHeaders ¶
Types ¶
type Assign ¶
type Assign struct { TokenData // contains filtered or unexported fields }
func NewAssign ¶
func NewAssign(lhs Expression, rhs Expression, op string, ctx context.Context) *Assign
func (*Assign) AddStatement ¶
func (*Assign) EvalStatement ¶
func (*Assign) GetLhsVarExpression ¶
func (t *Assign) GetLhsVarExpression() (*VarExpression, error)
func (*Assign) HasLhsVarExpression ¶
func (*Assign) HoistNames ¶
func (*Assign) ResolveExpressionActivity ¶
func (*Assign) ResolveExpressionNames ¶
func (*Assign) ResolveStatementActivity ¶
func (*Assign) ResolveStatementNames ¶
func (*Assign) UniqueExpressionNames ¶
func (*Assign) UniqueStatementNames ¶
func (*Assign) UniversalExpressionNames ¶
func (*Assign) UniversalStatementNames ¶
func (*Assign) WriteExpression ¶
type Await ¶
type Await struct { TokenData // contains filtered or unexported fields }
func (*Await) AddStatement ¶
func (*Await) EvalStatement ¶
func (*Await) HoistNames ¶
func (*Await) ResolveExpressionActivity ¶
func (*Await) ResolveExpressionNames ¶
func (*Await) ResolveStatementActivity ¶
func (*Await) ResolveStatementNames ¶
func (*Await) UniqueExpressionNames ¶
func (*Await) UniqueStatementNames ¶
func (*Await) UniversalExpressionNames ¶
func (*Await) UniversalStatementNames ¶
func (*Await) WriteExpression ¶
type BinaryBitOp ¶
type BinaryBitOp struct {
BinaryOp
}
func (*BinaryBitOp) EvalExpression ¶
func (t *BinaryBitOp) EvalExpression() (values.Value, error)
func (*BinaryBitOp) Walk ¶
func (t *BinaryBitOp) Walk(fn WalkFunc) error
TODO: implement for each special function
type BinaryOp ¶
type BinaryOp struct { TokenData // contains filtered or unexported fields }
func (*BinaryOp) ResolveExpressionActivity ¶
func (*BinaryOp) ResolveExpressionNames ¶
func (*BinaryOp) UniqueExpressionNames ¶
func (*BinaryOp) UniversalExpressionNames ¶
func (*BinaryOp) WriteExpression ¶
type BitAndOp ¶
type BitAndOp struct {
BinaryBitOp
}
type BitNotOp ¶
type BitNotOp struct {
PreUnaryOp
}
type BitOrOp ¶
type BitOrOp struct {
BinaryBitOp
}
type BitXorOp ¶
type BitXorOp struct {
BinaryBitOp
}
type Block ¶
type Block struct { TokenData // contains filtered or unexported fields }
func (*Block) AddStatement ¶
func (*Block) EvalStatement ¶
func (*Block) HoistAndResolveStatementNames ¶
func (*Block) HoistNames ¶
///////////////////////// 1. Name resolution stage /////////////////////////
func (*Block) ResolveStatementActivity ¶
func (*Block) ResolveStatementNames ¶
func (*Block) UniqueStatementNames ¶
func (*Block) UniversalStatementNames ¶
type BlockScope ¶
type BlockScope struct {
ScopeData
}
func NewBlockScope ¶
func NewBlockScope(parent Scope) *BlockScope
func (*BlockScope) SetVariable ¶
func (t *BlockScope) SetVariable(name string, v Variable) error
vars are hoisted out (use SubScope to avoid this)
type BranchScope ¶
type BranchScope struct {
ScopeData
}
func NewBranchScope ¶
func NewBranchScope(parent Scope) *BranchScope
func (*BranchScope) IsAsync ¶
func (scope *BranchScope) IsAsync() bool
func (*BranchScope) IsBreakable ¶
func (scope *BranchScope) IsBreakable() bool
func (*BranchScope) IsContinueable ¶
func (scope *BranchScope) IsContinueable() bool
type Break ¶
type Break struct {
TokenData
}
func (*Break) AddStatement ¶
func (*Break) EvalStatement ¶
func (*Break) HoistNames ¶
func (*Break) ResolveStatementActivity ¶
func (*Break) ResolveStatementNames ¶
func (*Break) UniqueStatementNames ¶
func (*Break) UniversalStatementNames ¶
type Call ¶
type Call struct { TokenData // contains filtered or unexported fields }
func NewCall ¶
func NewCall(lhs Expression, args []Expression, ctx context.Context) *Call
func (*Call) AddStatement ¶
func (*Call) Args ¶
func (t *Call) Args() []Expression
func (*Call) EvalStatement ¶
func (*Call) HoistNames ¶
func (*Call) ResolveExpressionActivity ¶
func (*Call) ResolveExpressionNames ¶
func (*Call) ResolveStatementActivity ¶
func (*Call) ResolveStatementNames ¶
func (*Call) UniqueExpressionNames ¶
func (*Call) UniqueStatementNames ¶
func (*Call) UniversalExpressionNames ¶
func (*Call) UniversalStatementNames ¶
func (*Call) WriteExpression ¶
type CaseScope ¶
type CaseScope struct {
ScopeData
}
func NewCaseScope ¶
func (*CaseScope) IsBreakable ¶
func (*CaseScope) IsContinueable ¶
type Class ¶
type Class struct { TokenData // contains filtered or unexported fields }
only support single inheritance (easier to maintain code, and similar to java)
func NewClass ¶
func NewClass(nameExpr *TypeExpression, parentExpr *TypeExpression, interfExprs []*VarExpression, isAbstract bool, isFinal bool, universalName string, ctx context.Context) (*Class, error)
func (*Class) AddConstructor ¶
func (*Class) AddFunction ¶
func (*Class) AddProperty ¶
func (t *Class) AddProperty(name *Word, expr *TypeExpression) error
func (*Class) AddStatement ¶
func (*Class) EvalStatement ¶
func (*Class) GetClassMember ¶
func (*Class) GetInstanceMember ¶
func (t *Class) GetInstanceMember(key string, includePrivate bool, ctx context.Context) (values.Value, error)
potentially return Setter/Getter as second ClassMember return non-nil prototypes.BuiltinPrototype for further specific searching
func (*Class) GetVariable ¶
func (*Class) HoistNames ¶
func (*Class) IsAbstract ¶
func (*Class) IsUniversal ¶
func (*Class) ResolveExpressionActivity ¶
func (*Class) ResolveExpressionNames ¶
func (*Class) ResolveStatementActivity ¶
func (*Class) ResolveStatementNames ¶
func (*Class) SetInstanceMember ¶
func (*Class) UniqueExpressionNames ¶
func (*Class) UniqueStatementNames ¶
func (*Class) UniversalExpressionNames ¶
func (*Class) UniversalStatementNames ¶
func (*Class) WriteExpression ¶
type ClassFunction ¶
type ClassFunction struct {
// contains filtered or unexported fields
}
implements the values.Callable interface
func NewClassFunction ¶
func NewClassFunction(fn *Function) *ClassFunction
func (*ClassFunction) Context ¶
func (m *ClassFunction) Context() context.Context
func (*ClassFunction) Dump ¶
func (m *ClassFunction) Dump(indent string) string
func (*ClassFunction) Eval ¶
func (m *ClassFunction) Eval() error
func (*ClassFunction) GetThisVariable ¶
func (m *ClassFunction) GetThisVariable() Variable
func (*ClassFunction) IsUniversal ¶
func (m *ClassFunction) IsUniversal() bool
func (*ClassFunction) Name ¶
func (m *ClassFunction) Name() string
func (*ClassFunction) ResolveActivity ¶
func (m *ClassFunction) ResolveActivity(usage Usage) error
func (*ClassFunction) ResolveNames ¶
func (m *ClassFunction) ResolveNames(scope Scope) error
func (*ClassFunction) Role ¶
func (m *ClassFunction) Role() prototypes.FunctionRole
func (*ClassFunction) UniqueNames ¶
func (m *ClassFunction) UniqueNames(ns Namespace) error
func (*ClassFunction) UniversalNames ¶
func (m *ClassFunction) UniversalNames(ns Namespace) error
func (*ClassFunction) Walk ¶
func (m *ClassFunction) Walk(fn WalkFunc) error
func (*ClassFunction) WriteStatement ¶
type ClassMember ¶
type ClassMember interface { Context() context.Context Name() string Dump(indent string) string WriteStatement(usage Usage, indent string, nl string, tab string) string Role() prototypes.FunctionRole IsUniversal() bool // functions are always universal, properties not necessarily ResolveNames(scope Scope) error GetValue(ctx context.Context) (values.Value, error) SetValue(v values.Value, ctx context.Context) error Eval() error ResolveActivity(usage Usage) error UniversalNames(ns Namespace) error UniqueNames(ns Namespace) error Walk(fn WalkFunc) error }
type ClassProperty ¶
type ClassProperty struct {
// contains filtered or unexported fields
}
func NewClassProperty ¶
func NewClassProperty(name *Word, typeExpr *TypeExpression) *ClassProperty
func (*ClassProperty) Context ¶
func (p *ClassProperty) Context() context.Context
func (*ClassProperty) Dump ¶
func (p *ClassProperty) Dump(indent string) string
func (*ClassProperty) Eval ¶
func (p *ClassProperty) Eval() error
func (*ClassProperty) IsUniversal ¶
func (p *ClassProperty) IsUniversal() bool
func (*ClassProperty) Name ¶
func (p *ClassProperty) Name() string
func (*ClassProperty) ResolveActivity ¶
func (p *ClassProperty) ResolveActivity(usage Usage) error
func (*ClassProperty) ResolveNames ¶
func (p *ClassProperty) ResolveNames(scope Scope) error
func (*ClassProperty) Role ¶
func (p *ClassProperty) Role() prototypes.FunctionRole
func (*ClassProperty) UniqueNames ¶
func (p *ClassProperty) UniqueNames(ns Namespace) error
func (*ClassProperty) UniversalNames ¶
func (p *ClassProperty) UniversalNames(ns Namespace) error
func (*ClassProperty) Walk ¶
func (p *ClassProperty) Walk(fn WalkFunc) error
func (*ClassProperty) WriteStatement ¶
type ClassScope ¶
type ClassScope struct { ScopeData // contains filtered or unexported fields }
func NewClassScope ¶
func NewClassScope(class *Class, parent Scope) *ClassScope
func (*ClassScope) FriendlyPrototypes ¶
func (s *ClassScope) FriendlyPrototypes() []values.Prototype
type Continue ¶
type Continue struct {
TokenData
}
func (*Continue) AddStatement ¶
func (*Continue) EvalStatement ¶
func (*Continue) HoistNames ¶
func (*Continue) ResolveStatementActivity ¶
func (*Continue) ResolveStatementNames ¶
func (*Continue) UniqueStatementNames ¶
func (*Continue) UniversalStatementNames ¶
type DeleteOp ¶
type DeleteOp struct {
PreUnaryOp
}
func NewDeleteOp ¶
func NewDeleteOp(a Expression, ctx context.Context) *DeleteOp
func (*DeleteOp) EvalStatement ¶
func (*DeleteOp) ResolveStatementActivity ¶
func (*DeleteOp) ResolveStatementNames ¶
func (*DeleteOp) UniqueStatementNames ¶
func (*DeleteOp) UniversalStatementNames ¶
type DontKeepSignRightShiftOp ¶
type DontKeepSignRightShiftOp struct {
ShiftOp
}
type Enum ¶
type Enum struct { TokenData // contains filtered or unexported fields }
enum is a statement (and also a Class!)
func NewEnum ¶
func NewEnum(nameExpr *TypeExpression, parentExpr *TypeExpression, keys []*Word, vs []Expression, ctx context.Context) (*Enum, error)
func (*Enum) AddStatement ¶
func (*Enum) EvalStatement ¶
XXX: should enums be available as expressions
func (*Enum) GetClassMember ¶
func (*Enum) GetClassValue ¶
can never be directly constructed
func (*Enum) GetInstanceMember ¶
func (*Enum) GetVariable ¶
func (*Enum) HoistNames ¶
func (*Enum) IsAbstract ¶
func (*Enum) IsUniversal ¶
func (*Enum) ResolveStatementActivity ¶
func (*Enum) ResolveStatementNames ¶
func (*Enum) SetInstanceMember ¶
func (*Enum) UniqueStatementNames ¶
func (*Enum) UniversalStatementNames ¶
type EnumMember ¶
type EnumMember struct {
// contains filtered or unexported fields
}
func (*EnumMember) Context ¶
func (m *EnumMember) Context() context.Context
func (*EnumMember) Walk ¶
func (m *EnumMember) Walk(fn WalkFunc) error
type EqCompareOp ¶
type EqCompareOp struct {
BinaryOp
}
func (*EqCompareOp) EvalExpression ¶
func (t *EqCompareOp) EvalExpression() (values.Value, error)
func (*EqCompareOp) Walk ¶
func (t *EqCompareOp) Walk(fn WalkFunc) error
TODO: implement for specific types
type EqOp ¶
type EqOp struct {
EqCompareOp
}
type Export ¶
type Export struct { TokenData // contains filtered or unexported fields }
func (*Export) AddStatement ¶
func (*Export) EvalStatement ¶
func (*Export) HoistNames ¶
func (*Export) ResolveStatementActivity ¶
func (*Export) ResolveStatementNames ¶
func (*Export) UniqueStatementNames ¶
func (*Export) UniversalStatementNames ¶
type ExportedVariable ¶
type ExportedVariable struct {
// contains filtered or unexported fields
}
type Expression ¶
type Expression interface { WriteExpression() string ResolveExpressionNames(scope Scope) error EvalExpression() (values.Value, error) ResolveExpressionActivity(usage Usage) error // universal names need to be registered before other unique names are generated UniversalExpressionNames(ns Namespace) error UniqueExpressionNames(ns Namespace) error Walk(fn WalkFunc) error Token }
type FillPackageFunction ¶
type For ¶
type For struct { ForBlock // contains filtered or unexported fields }
func NewFor ¶
func NewFor(varType VarType, inits []Expression, cond Expression, incrs []Expression, ctx context.Context) (*For, error)
inits can be empty, cond can be nil, incrs can be empty in extreme case 'for(;;);' is written
func (*For) EvalStatement ¶
func (*For) HoistNames ¶
func (*For) ResolveStatementActivity ¶
func (*For) ResolveStatementNames ¶
func (*For) UniqueStatementNames ¶
func (*For) UniversalStatementNames ¶
type ForBlock ¶
type ForBlock struct { Block // contains filtered or unexported fields }
common for For, ForIn, ForOf all for statements must specify a new variable using const, let or var
type ForIn ¶
type ForIn struct {
ForInOf
}
func NewForIn ¶
func NewForIn(varType VarType, lhs *VarExpression, rhs Expression, ctx context.Context) (*ForIn, error)
func (*ForIn) EvalStatement ¶
type ForInOf ¶
type ForInOf struct { ForBlock // contains filtered or unexported fields }
common base class for ForIn and ForOf
func (*ForInOf) HoistNames ¶
///////////////////////// 1. Name resolution stage /////////////////////////
func (*ForInOf) ResolveStatementActivity ¶
func (*ForInOf) ResolveStatementNames ¶
func (*ForInOf) UniqueStatementNames ¶
func (*ForInOf) UniversalStatementNames ¶
type ForOf ¶
type ForOf struct { ForInOf // contains filtered or unexported fields }
func NewForOf ¶
func NewForOf(await bool, varType VarType, lhs *VarExpression, rhs Expression, ctx context.Context) (*ForOf, error)
func (*ForOf) EvalStatement ¶
type Function ¶
type Function struct { Block // contains filtered or unexported fields }
func NewFunction ¶
func (*Function) EvalStatement ¶
func (*Function) GetReturnValue ¶
post async return type can be nil in case of void
func (*Function) GetThisVariable ¶
func (*Function) GetVariable ¶
func (*Function) HoistNames ¶
func (*Function) Interface ¶
func (t *Function) Interface() *FunctionInterface
func (*Function) NewScope ¶
func (t *Function) NewScope(parent Scope) *FunctionScope
func (*Function) RegisterReturn ¶
func (*Function) ResolveExpressionActivity ¶
func (*Function) ResolveExpressionNames ¶
func (*Function) ResolveStatementActivity ¶
func (*Function) ResolveStatementNames ¶
func (*Function) Role ¶
func (t *Function) Role() prototypes.FunctionRole
func (*Function) UniqueExpressionNames ¶
func (*Function) UniqueStatementNames ¶
func (*Function) UniversalExpressionNames ¶
func (*Function) UniversalStatementNames ¶
func (*Function) WriteExpression ¶
type FunctionArgument ¶
type FunctionArgument struct { TokenData // contains filtered or unexported fields }
func NewFunctionArgument ¶
func NewFunctionArgument(name string, typeExpr *TypeExpression, def Expression, ctx context.Context) (*FunctionArgument, error)
func (*FunctionArgument) AssertNoDefault ¶
func (fa *FunctionArgument) AssertNoDefault() error
func (*FunctionArgument) Dump ¶
func (fa *FunctionArgument) Dump(indent string) string
func (*FunctionArgument) Eval ¶
func (fa *FunctionArgument) Eval() error
func (*FunctionArgument) GetVariable ¶
func (fa *FunctionArgument) GetVariable() Variable
func (*FunctionArgument) HasDefault ¶
func (fa *FunctionArgument) HasDefault() bool
func (*FunctionArgument) Name ¶
func (fa *FunctionArgument) Name() string
func (*FunctionArgument) ResolveInterfaceNames ¶
func (fa *FunctionArgument) ResolveInterfaceNames(scope Scope) error
func (*FunctionArgument) ResolveNames ¶
func (fa *FunctionArgument) ResolveNames(scope Scope) error
func (*FunctionArgument) TypeName ¶
func (fa *FunctionArgument) TypeName() string
func (*FunctionArgument) UniqueNames ¶
func (fa *FunctionArgument) UniqueNames(ns Namespace) error
func (*FunctionArgument) UniversalNames ¶
func (fa *FunctionArgument) UniversalNames(ns Namespace) error
func (*FunctionArgument) Walk ¶
func (fa *FunctionArgument) Walk(fn WalkFunc) error
func (*FunctionArgument) Write ¶
func (fa *FunctionArgument) Write() string
type FunctionInterface ¶
type FunctionInterface struct {
// contains filtered or unexported fields
}
func NewFunctionInterface ¶
func NewFunctionInterface(name string, role prototypes.FunctionRole, ctx context.Context) *FunctionInterface
func (*FunctionInterface) AppendArg ¶
func (fi *FunctionInterface) AppendArg(arg *FunctionArgument)
func (*FunctionInterface) AssertNoDefaults ¶
func (fi *FunctionInterface) AssertNoDefaults() error
func (*FunctionInterface) CheckRPC ¶
func (fi *FunctionInterface) CheckRPC() error
func (*FunctionInterface) Context ¶
func (fi *FunctionInterface) Context() context.Context
func (*FunctionInterface) Dump ¶
func (fi *FunctionInterface) Dump() string
func (*FunctionInterface) Eval ¶
func (fi *FunctionInterface) Eval() error
func (*FunctionInterface) GetArgValues ¶
func (fi *FunctionInterface) GetArgValues() ([]values.Value, error)
func (*FunctionInterface) GetFunctionValue ¶
func (fi *FunctionInterface) GetFunctionValue() (*values.Function, error)
func (*FunctionInterface) GetReturnValue ¶
func (fi *FunctionInterface) GetReturnValue() (values.Value, error)
post async
func (*FunctionInterface) GetVariable ¶
func (fi *FunctionInterface) GetVariable() Variable
func (*FunctionInterface) IsVoid ¶
func (fi *FunctionInterface) IsVoid() bool
func (*FunctionInterface) Length ¶
func (fi *FunctionInterface) Length() int
func (*FunctionInterface) Name ¶
func (fi *FunctionInterface) Name() string
func (*FunctionInterface) ResolveNames ¶
func (fi *FunctionInterface) ResolveNames(scope Scope) error
func (*FunctionInterface) Role ¶
func (fi *FunctionInterface) Role() prototypes.FunctionRole
func (*FunctionInterface) SetReturnType ¶
func (fi *FunctionInterface) SetReturnType(ret *TypeExpression)
used by parser to gradually fill the interface struct
func (*FunctionInterface) SetRole ¶
func (fi *FunctionInterface) SetRole(r prototypes.FunctionRole)
func (*FunctionInterface) UniqueNames ¶
func (fi *FunctionInterface) UniqueNames(ns Namespace) error
func (*FunctionInterface) UniversalNames ¶
func (fi *FunctionInterface) UniversalNames(ns Namespace) error
func (*FunctionInterface) Walk ¶
func (fi *FunctionInterface) Walk(fn WalkFunc) error
func (*FunctionInterface) Write ¶
func (fi *FunctionInterface) Write() string
type FunctionScope ¶
type FunctionScope struct { ScopeData // contains filtered or unexported fields }
func NewFunctionScope ¶
func NewFunctionScope(fn *Function, parent Scope) *FunctionScope
func (*FunctionScope) GetFunction ¶
func (fs *FunctionScope) GetFunction() *Function
func (*FunctionScope) IsAsync ¶
func (fs *FunctionScope) IsAsync() bool
func (*FunctionScope) SetVariable ¶
func (fs *FunctionScope) SetVariable(name string, v Variable) error
type GEOp ¶
type GEOp struct {
OrderCompareOp
}
type GTOp ¶
type GTOp struct {
OrderCompareOp
}
type GlobalScope ¶
func GetGlobalScope ¶
func GetGlobalScope(s_ Scope) GlobalScope
type GlobalScopeData ¶
type GlobalScopeData struct {
ScopeData
}
wrapped by BundleScope in order to implement the GlobalScope interface
func NewFilledGlobalScope ¶
func NewFilledGlobalScope() *GlobalScopeData
func (*GlobalScopeData) GetVariable ¶
func (s *GlobalScopeData) GetVariable(name string) (Variable, error)
type If ¶
type If struct { Block // dont use the Block.statements // contains filtered or unexported fields }
func (*If) AddCondition ¶
func (t *If) AddCondition(expr Expression) error
func (*If) AddStatement ¶
func (*If) EvalStatement ¶
func (*If) HoistNames ¶
func (*If) ResolveStatementActivity ¶
func (*If) ResolveStatementNames ¶
func (*If) UniqueStatementNames ¶
func (*If) UniversalStatementNames ¶
type Import ¶
type Import struct { TokenData // contains filtered or unexported fields }
func (*Import) AddStatement ¶
func (*Import) EvalStatement ¶
func (*Import) HoistNames ¶
func (*Import) ResolveStatementActivity ¶
func (*Import) ResolveStatementNames ¶
func (*Import) UniqueStatementNames ¶
func (*Import) UniversalStatementNames ¶
type ImportedVariable ¶
type ImportedVariable struct {
// contains filtered or unexported fields
}
func NewImportedVariable ¶
func NewImportedVariable(oldName, newName string, pathLiteral *LiteralString, lang files.Lang, ctx context.Context) (*ImportedVariable, error)
func (*ImportedVariable) AbsPath ¶
func (iv *ImportedVariable) AbsPath() string
func (*ImportedVariable) Context ¶
func (iv *ImportedVariable) Context() context.Context
func (*ImportedVariable) GetVariable ¶
func (iv *ImportedVariable) GetVariable() Variable
func (*ImportedVariable) PathContext ¶
func (iv *ImportedVariable) PathContext() context.Context
func (*ImportedVariable) PathLiteral ¶
func (iv *ImportedVariable) PathLiteral() *LiteralString
func (*ImportedVariable) Walk ¶
func (iv *ImportedVariable) Walk(fn WalkFunc) error
type Index ¶
type Index struct { TokenData // contains filtered or unexported fields }
func NewIndex ¶
func NewIndex(container Expression, index Expression, ctx context.Context) *Index
func (*Index) ResolveExpressionActivity ¶
func (*Index) ResolveExpressionNames ¶
///////////////////////// 1. Name resolution stage /////////////////////////
func (*Index) UniqueExpressionNames ¶
func (*Index) UniversalExpressionNames ¶
func (*Index) WriteExpression ¶
type InstanceOf ¶
type InstanceOf struct { BinaryOp // contains filtered or unexported fields }
in a file by itself because it is more complex than the typical operator
func NewInstanceOf ¶
func NewInstanceOf(a Expression, b Expression, ctx context.Context) (*InstanceOf, error)
func (*InstanceOf) CollectTypeGuards ¶
func (*InstanceOf) EvalExpression ¶
func (t *InstanceOf) EvalExpression() (values.Value, error)
func (*InstanceOf) ResolveExpressionNames ¶
func (t *InstanceOf) ResolveExpressionNames(scope Scope) error
func (*InstanceOf) Walk ¶
func (t *InstanceOf) Walk(fn WalkFunc) error
func (*InstanceOf) WriteExpression ¶
func (t *InstanceOf) WriteExpression() string
type Interface ¶
type Interface struct { TokenData // contains filtered or unexported fields }
func NewInterface ¶
func NewInterface(nameExpr *TypeExpression, parents []*VarExpression, isRPC bool, ctx context.Context) (*Interface, error)
func (*Interface) AddMember ¶
func (t *Interface) AddMember(member *FunctionInterface) error
func (*Interface) AddStatement ¶
func (*Interface) EvalStatement ¶
func (*Interface) GetInstanceMember ¶
func (*Interface) GetVariable ¶
func (*Interface) HoistNames ¶
func (*Interface) IsUniversal ¶
can only be called after eval phase! (because registration is done during eval phase)
func (*Interface) ResolveStatementActivity ¶
func (*Interface) ResolveStatementNames ¶
func (*Interface) SetInstanceMember ¶
func (*Interface) UniqueStatementNames ¶
func (*Interface) UniversalStatementNames ¶
type KeepSignRightShiftOp ¶
type KeepSignRightShiftOp struct {
ShiftOp
}
type LEOp ¶
type LEOp struct {
OrderCompareOp
}
type LTOp ¶
type LTOp struct {
OrderCompareOp
}
type LeftShiftOp ¶
type LeftShiftOp struct {
ShiftOp
}
type LiteralArray ¶
type LiteralArray struct { LiteralData // contains filtered or unexported fields }
func NewLiteralArray ¶
func NewLiteralArray(items []Expression, ctx context.Context) *LiteralArray
func (*LiteralArray) Dump ¶
func (t *LiteralArray) Dump(indent string) string
func (*LiteralArray) EvalExpression ¶
func (t *LiteralArray) EvalExpression() (values.Value, error)
func (*LiteralArray) ResolveExpressionActivity ¶
func (t *LiteralArray) ResolveExpressionActivity(usage Usage) error
func (*LiteralArray) ResolveExpressionNames ¶
func (t *LiteralArray) ResolveExpressionNames(scope Scope) error
func (*LiteralArray) UniqueExpressionNames ¶
func (t *LiteralArray) UniqueExpressionNames(ns Namespace) error
func (*LiteralArray) UniversalExpressionNames ¶
func (t *LiteralArray) UniversalExpressionNames(ns Namespace) error
func (*LiteralArray) Walk ¶
func (t *LiteralArray) Walk(fn WalkFunc) error
func (*LiteralArray) WriteExpression ¶
func (t *LiteralArray) WriteExpression() string
type LiteralBoolean ¶
type LiteralBoolean struct { LiteralData // contains filtered or unexported fields }
func NewLiteralBoolean ¶
func NewLiteralBoolean(value bool, ctx context.Context) *LiteralBoolean
func (*LiteralBoolean) Dump ¶
func (t *LiteralBoolean) Dump(indent string) string
func (*LiteralBoolean) EvalExpression ¶
func (t *LiteralBoolean) EvalExpression() (values.Value, error)
func (*LiteralBoolean) Value ¶
func (t *LiteralBoolean) Value() bool
func (*LiteralBoolean) Walk ¶
func (t *LiteralBoolean) Walk(fn WalkFunc) error
func (*LiteralBoolean) WriteExpression ¶
func (t *LiteralBoolean) WriteExpression() string
type LiteralData ¶
type LiteralData struct {
TokenData
}
intended for LiteralInt, LiteralBool, LiteralFloat, LiteralString and LiteralNull
func (*LiteralData) ResolveExpressionActivity ¶
func (t *LiteralData) ResolveExpressionActivity(usage Usage) error
func (*LiteralData) ResolveExpressionNames ¶
func (t *LiteralData) ResolveExpressionNames(scope Scope) error
func (*LiteralData) UniqueExpressionNames ¶
func (t *LiteralData) UniqueExpressionNames(ns Namespace) error
func (*LiteralData) UniversalExpressionNames ¶
func (t *LiteralData) UniversalExpressionNames(ns Namespace) error
type LiteralFloat ¶
type LiteralFloat struct { LiteralData // contains filtered or unexported fields }
func NewLiteralFloat ¶
func NewLiteralFloat(value float64, ctx context.Context) *LiteralFloat
func (*LiteralFloat) Dump ¶
func (t *LiteralFloat) Dump(indent string) string
func (*LiteralFloat) EvalExpression ¶
func (t *LiteralFloat) EvalExpression() (values.Value, error)
func (*LiteralFloat) Value ¶
func (t *LiteralFloat) Value() float64
func (*LiteralFloat) Walk ¶
func (t *LiteralFloat) Walk(fn WalkFunc) error
func (*LiteralFloat) WriteExpression ¶
func (t *LiteralFloat) WriteExpression() string
type LiteralInt ¶
type LiteralInt struct { LiteralData // contains filtered or unexported fields }
func NewLiteralInt ¶
func NewLiteralInt(value int, ctx context.Context) *LiteralInt
func (*LiteralInt) Dump ¶
func (t *LiteralInt) Dump(indent string) string
func (*LiteralInt) EvalExpression ¶
func (t *LiteralInt) EvalExpression() (values.Value, error)
func (*LiteralInt) Value ¶
func (t *LiteralInt) Value() int
func (*LiteralInt) Walk ¶
func (t *LiteralInt) Walk(fn WalkFunc) error
func (*LiteralInt) WriteExpression ¶
func (t *LiteralInt) WriteExpression() string
type LiteralNull ¶
type LiteralNull struct {
LiteralData
}
func NewLiteralNull ¶
func NewLiteralNull(ctx context.Context) *LiteralNull
func (*LiteralNull) Dump ¶
func (t *LiteralNull) Dump(indent string) string
func (*LiteralNull) EvalExpression ¶
func (t *LiteralNull) EvalExpression() (values.Value, error)
func (*LiteralNull) Walk ¶
func (t *LiteralNull) Walk(fn WalkFunc) error
func (*LiteralNull) WriteExpression ¶
func (t *LiteralNull) WriteExpression() string
type LiteralObject ¶
type LiteralObject struct { TokenData // contains filtered or unexported fields }
func NewLiteralObject ¶
func NewLiteralObject(keys []*Word, values []Expression, ctx context.Context) (*LiteralObject, error)
func (*LiteralObject) Dump ¶
func (t *LiteralObject) Dump(indent string) string
func (*LiteralObject) EvalExpression ¶
func (t *LiteralObject) EvalExpression() (values.Value, error)
func (*LiteralObject) ResolveExpressionActivity ¶
func (t *LiteralObject) ResolveExpressionActivity(usage Usage) error
func (*LiteralObject) ResolveExpressionNames ¶
func (t *LiteralObject) ResolveExpressionNames(scope Scope) error
func (*LiteralObject) UniqueExpressionNames ¶
func (t *LiteralObject) UniqueExpressionNames(ns Namespace) error
func (*LiteralObject) UniversalExpressionNames ¶
func (t *LiteralObject) UniversalExpressionNames(ns Namespace) error
func (*LiteralObject) Walk ¶
func (t *LiteralObject) Walk(fn WalkFunc) error
func (*LiteralObject) WriteExpression ¶
func (t *LiteralObject) WriteExpression() string
type LiteralObjectMember ¶
type LiteralObjectMember struct {
// contains filtered or unexported fields
}
func (*LiteralObjectMember) Walk ¶
func (m *LiteralObjectMember) Walk(fn WalkFunc) error
type LiteralString ¶
type LiteralString struct { LiteralData // contains filtered or unexported fields }
func NewLiteralString ¶
func NewLiteralString(value string, ctx context.Context) *LiteralString
func (*LiteralString) Dump ¶
func (t *LiteralString) Dump(indent string) string
func (*LiteralString) EvalExpression ¶
func (t *LiteralString) EvalExpression() (values.Value, error)
func (*LiteralString) InnerContext ¶
func (t *LiteralString) InnerContext() context.Context
for refactoring
func (*LiteralString) Value ¶
func (t *LiteralString) Value() string
func (*LiteralString) Walk ¶
func (t *LiteralString) Walk(fn WalkFunc) error
func (*LiteralString) WriteExpression ¶
func (t *LiteralString) WriteExpression() string
type LogicalAndOp ¶
type LogicalAndOp struct {
LogicalBinaryOp
}
func (*LogicalAndOp) CollectTypeGuards ¶
func (*LogicalAndOp) Walk ¶
func (t *LogicalAndOp) Walk(fn WalkFunc) error
type LogicalBinaryOp ¶
type LogicalBinaryOp struct {
BinaryOp
}
func (*LogicalBinaryOp) EvalExpression ¶
func (t *LogicalBinaryOp) EvalExpression() (values.Value, error)
type LogicalNotOp ¶
type LogicalNotOp struct {
PreUnaryOp
}
func (*LogicalNotOp) EvalExpression ¶
func (t *LogicalNotOp) EvalExpression() (values.Value, error)
func (*LogicalNotOp) Walk ¶
func (t *LogicalNotOp) Walk(fn WalkFunc) error
type LogicalOrOp ¶
type LogicalOrOp struct {
LogicalBinaryOp
}
func (*LogicalOrOp) Walk ¶
func (t *LogicalOrOp) Walk(fn WalkFunc) error
type LoopScope ¶
type LoopScope struct {
ScopeData
}
func NewLoopScope ¶
func (*LoopScope) IsBreakable ¶
func (*LoopScope) IsContinueable ¶
type Member ¶
type Member struct { TokenData // contains filtered or unexported fields }
func (*Member) GetPackageMember ¶
return nil if this is not a package member
func (*Member) IsBuiltinPackage ¶
func (*Member) ObjectContext ¶
used for refactoring
func (*Member) ObjectNameAndKey ¶
return empty name if object is not VarExpression
func (*Member) PackageName ¶
func (*Member) ResolveExpressionActivity ¶
func (*Member) ResolveExpressionNames ¶
func (*Member) ToTypeExpression ¶
func (t *Member) ToTypeExpression() (*TypeExpression, error)
func (*Member) UniqueExpressionNames ¶
func (*Member) UniversalExpressionNames ¶
func (*Member) WriteExpression ¶
type ModuleData ¶
type ModuleData struct { Block // contains filtered or unexported fields }
func GetModule ¶
func GetModule(s_ Scope) *ModuleData
func NewModule ¶
func NewModule(ctx context.Context) *ModuleData
func (*ModuleData) AddAggregateExport ¶
func (m *ModuleData) AddAggregateExport(newName, oldName string, pathLiteral *LiteralString, lang files.Lang, ctx context.Context) error
func (*ModuleData) AddExportedName ¶
func (*ModuleData) AddImportedName ¶
func (m *ModuleData) AddImportedName(newName, oldName string, pathLiteral *LiteralString, lang files.Lang, ctx context.Context) error
func (*ModuleData) Dependencies ¶
func (m *ModuleData) Dependencies() []files.PathLang
import statements must be toplevel, so we could instead loop the statements
func (*ModuleData) Dump ¶
func (m *ModuleData) Dump() string
func (*ModuleData) EvalTypes ¶
func (m *ModuleData) EvalTypes() error
func (*ModuleData) GetExportedVariable ¶
func (m *ModuleData) GetExportedVariable(gs GlobalScope, name string, nameCtx context.Context) (Variable, error)
called from within other module
func (*ModuleData) Parent ¶
func (m *ModuleData) Parent() Scope
func (*ModuleData) ResolveActivity ¶
func (m *ModuleData) ResolveActivity(usage Usage) error
func (*ModuleData) ResolveNames ¶
func (m *ModuleData) ResolveNames(gs GlobalScope) error
func (*ModuleData) UniqueEntryPointNames ¶
func (m *ModuleData) UniqueEntryPointNames(ns Namespace) error
func (*ModuleData) UniqueNames ¶
func (m *ModuleData) UniqueNames(ns Namespace) error
func (*ModuleData) UniversalNames ¶
func (m *ModuleData) UniversalNames(ns Namespace) error
func (*ModuleData) Walk ¶
func (m *ModuleData) Walk(fn WalkFunc) error
type ModuleScope ¶
type ModuleScope struct { ScopeData // contains filtered or unexported fields }
func (*ModuleScope) GetVariable ¶
func (ms *ModuleScope) GetVariable(name string) (Variable, error)
func (*ModuleScope) HasVariable ¶
func (ms *ModuleScope) HasVariable(name string) bool
type NEOp ¶
type NEOp struct {
EqCompareOp
}
type Namespace ¶
type Namespace interface { NewBlockNamespace() Namespace NewFunctionNamespace() Namespace CurrentFunctionNamespace() Namespace UniversalName(v Variable, name string) error ClassName(v Variable) error // classnames must be the same project wide! FunctionName(v Variable) ArgName(v Variable) LetName(v Variable) VarName(v Variable) LibName(v Variable, name string) error HasName(new string) bool HasVar(v Variable) bool }
func NewNamespace ¶
type NamespaceData ¶
type NamespaceData struct {
// contains filtered or unexported fields
}
func (*NamespaceData) ArgName ¶
func (ns *NamespaceData) ArgName(v Variable)
func (*NamespaceData) ClassName ¶
func (ns *NamespaceData) ClassName(v Variable) error
func (*NamespaceData) CurrentFunctionNamespace ¶
func (ns *NamespaceData) CurrentFunctionNamespace() Namespace
func (*NamespaceData) FunctionName ¶
func (ns *NamespaceData) FunctionName(v Variable)
func (*NamespaceData) HasName ¶
func (ns *NamespaceData) HasName(new string) bool
func (*NamespaceData) HasVar ¶
func (ns *NamespaceData) HasVar(v Variable) bool
func (*NamespaceData) LetName ¶
func (ns *NamespaceData) LetName(v Variable)
func (*NamespaceData) NewBlockNamespace ¶
func (ns *NamespaceData) NewBlockNamespace() Namespace
func (*NamespaceData) NewFunctionNamespace ¶
func (ns *NamespaceData) NewFunctionNamespace() Namespace
func (*NamespaceData) OriginalName ¶
func (ns *NamespaceData) OriginalName(v Variable, name string) error
func (*NamespaceData) UniversalName ¶
func (ns *NamespaceData) UniversalName(v Variable, name string) error
func (*NamespaceData) VarName ¶
func (ns *NamespaceData) VarName(v Variable)
type NegOp ¶
type NegOp struct {
PreUnaryOp
}
type NewOp ¶
type NewOp struct {
PreUnaryOp
}
no longer used, but keep the code anyway
func (*NewOp) WriteExpression ¶
type NodeJSImport ¶
type NodeJSImport struct { TokenData // contains filtered or unexported fields }
func NewNodeJSImport ¶
func NewNodeJSImport(name string, expr *VarExpression, ctx context.Context) *NodeJSImport
func (*NodeJSImport) AddStatement ¶
func (m *NodeJSImport) AddStatement(st Statement)
func (*NodeJSImport) Dump ¶
func (m *NodeJSImport) Dump(indent string) string
func (*NodeJSImport) EvalStatement ¶
func (m *NodeJSImport) EvalStatement() error
func (*NodeJSImport) HoistNames ¶
func (m *NodeJSImport) HoistNames(scope Scope) error
func (*NodeJSImport) ResolveStatementActivity ¶
func (m *NodeJSImport) ResolveStatementActivity(usage Usage) error
func (*NodeJSImport) ResolveStatementNames ¶
func (m *NodeJSImport) ResolveStatementNames(scope Scope) error
func (*NodeJSImport) UniqueStatementNames ¶
func (m *NodeJSImport) UniqueStatementNames(ns Namespace) error
func (*NodeJSImport) UniversalStatementNames ¶
func (m *NodeJSImport) UniversalStatementNames(ns Namespace) error
func (*NodeJSImport) Walk ¶
func (m *NodeJSImport) Walk(fn WalkFunc) error
func (*NodeJSImport) WriteStatement ¶
type Op ¶
type Op interface { Args() []Token Expression }
func NewBinaryOp ¶
func NewBinaryOp(op string, a Expression, b Expression, ctx context.Context) (Op, error)
func NewPostUnaryOp ¶
func NewPreUnaryOp ¶
func NewTernaryOp ¶
func NewTernaryOp(op string, a Expression, b Expression, c Expression, ctx context.Context) (Op, error)
type OrderCompareOp ¶
type OrderCompareOp struct {
BinaryOp
}
func (*OrderCompareOp) EvalExpression ¶
func (t *OrderCompareOp) EvalExpression() (values.Value, error)
>=, <=, >, <
func (*OrderCompareOp) Walk ¶
func (t *OrderCompareOp) Walk(fn WalkFunc) error
TODO: implement for specific types
type Package ¶
type Package struct { TokenData // contains filtered or unexported fields }
func NewPackage ¶
user packages start nameless
func (*Package) AddPrototype ¶
func (*Package) SetConstant ¶
func (t *Package) SetConstant()
type Parens ¶
type Parens struct { TokenData // contains filtered or unexported fields }
func (*Parens) CollectTypeGuards ¶
func (*Parens) ResolveExpressionActivity ¶
func (*Parens) ResolveExpressionNames ¶
func (*Parens) UniqueExpressionNames ¶
func (*Parens) UniversalExpressionNames ¶
func (*Parens) WriteExpression ¶
type PosOp ¶
type PosOp struct {
PreUnaryOp
}
type PostDecrOp ¶
type PostDecrOp struct {
PostUnaryOp
}
func NewPostDecrOp ¶
func NewPostDecrOp(a Expression, ctx context.Context) *PostDecrOp
func (*PostDecrOp) EvalExpression ¶
func (t *PostDecrOp) EvalExpression() (values.Value, error)
func (*PostDecrOp) EvalStatement ¶
func (t *PostDecrOp) EvalStatement() error
func (*PostDecrOp) ResolveStatementActivity ¶
func (t *PostDecrOp) ResolveStatementActivity(usage Usage) error
func (*PostDecrOp) ResolveStatementNames ¶
func (t *PostDecrOp) ResolveStatementNames(scope Scope) error
func (*PostDecrOp) UniqueStatementNames ¶
func (t *PostDecrOp) UniqueStatementNames(ns Namespace) error
func (*PostDecrOp) UniversalStatementNames ¶
func (t *PostDecrOp) UniversalStatementNames(ns Namespace) error
func (*PostDecrOp) Walk ¶
func (t *PostDecrOp) Walk(fn WalkFunc) error
func (*PostDecrOp) WriteStatement ¶
type PostIncrOp ¶
type PostIncrOp struct {
PostUnaryOp
}
func NewPostIncrOp ¶
func NewPostIncrOp(a Expression, ctx context.Context) *PostIncrOp
func (*PostIncrOp) EvalExpression ¶
func (t *PostIncrOp) EvalExpression() (values.Value, error)
func (*PostIncrOp) EvalStatement ¶
func (t *PostIncrOp) EvalStatement() error
func (*PostIncrOp) ResolveStatementActivity ¶
func (t *PostIncrOp) ResolveStatementActivity(usage Usage) error
func (*PostIncrOp) ResolveStatementNames ¶
func (t *PostIncrOp) ResolveStatementNames(scope Scope) error
func (*PostIncrOp) UniqueStatementNames ¶
func (t *PostIncrOp) UniqueStatementNames(ns Namespace) error
func (*PostIncrOp) UniversalStatementNames ¶
func (t *PostIncrOp) UniversalStatementNames(ns Namespace) error
func (*PostIncrOp) Walk ¶
func (t *PostIncrOp) Walk(fn WalkFunc) error
func (*PostIncrOp) WriteStatement ¶
type PostUnaryOp ¶
type PostUnaryOp struct {
UnaryOp
}
func (*PostUnaryOp) AddStatement ¶
func (t *PostUnaryOp) AddStatement(st Statement)
func (*PostUnaryOp) Dump ¶
func (t *PostUnaryOp) Dump(indent string) string
func (*PostUnaryOp) HoistNames ¶
func (t *PostUnaryOp) HoistNames(scope Scope) error
func (*PostUnaryOp) WriteExpression ¶
func (t *PostUnaryOp) WriteExpression() string
type PreUnaryOp ¶
type PreUnaryOp struct {
UnaryOp
}
func (*PreUnaryOp) AddStatement ¶
func (t *PreUnaryOp) AddStatement(st Statement)
func (*PreUnaryOp) Dump ¶
func (t *PreUnaryOp) Dump(indent string) string
func (*PreUnaryOp) HoistNames ¶
func (t *PreUnaryOp) HoistNames(scope Scope) error
func (*PreUnaryOp) WriteExpression ¶
func (t *PreUnaryOp) WriteExpression() string
type RemainderOp ¶
type RemainderOp struct {
BinaryOp
}
func (*RemainderOp) EvalExpression ¶
func (t *RemainderOp) EvalExpression() (values.Value, error)
func (*RemainderOp) Walk ¶
func (t *RemainderOp) Walk(fn WalkFunc) error
type Return ¶
type Return struct { TokenData // contains filtered or unexported fields }
func (*Return) AddStatement ¶
func (*Return) EvalStatement ¶
func (*Return) HoistNames ¶
func (*Return) ResolveStatementActivity ¶
func (*Return) ResolveStatementNames ¶
func (*Return) UniqueStatementNames ¶
func (*Return) UniversalStatementNames ¶
type ScopeData ¶
type ScopeData struct {
// contains filtered or unexported fields
}
eg. used by GlobalScope
func (*ScopeData) FriendlyPrototypes ¶
func (*ScopeData) GetFunction ¶
func (*ScopeData) HasVariable ¶
func (*ScopeData) IsBreakable ¶
func (*ScopeData) IsContinueable ¶
type ShiftOp ¶
type ShiftOp struct {
BinaryBitOp
}
type SpecialNumber ¶
type SpecialNumber struct { TokenData // contains filtered or unexported fields }
func NewSpecialNumber ¶
func NewSpecialNumber(value string, ctx context.Context) *SpecialNumber
func (*SpecialNumber) Dump ¶
func (t *SpecialNumber) Dump(indent string) string
func (*SpecialNumber) EvalExpression ¶
func (t *SpecialNumber) EvalExpression() (values.Value, error)
func (*SpecialNumber) ResolveExpressionActivity ¶
func (t *SpecialNumber) ResolveExpressionActivity(usage Usage) error
func (*SpecialNumber) ResolveExpressionNames ¶
func (t *SpecialNumber) ResolveExpressionNames(scope Scope) error
func (*SpecialNumber) UniqueExpressionNames ¶
func (t *SpecialNumber) UniqueExpressionNames(ns Namespace) error
func (*SpecialNumber) UniversalExpressionNames ¶
func (t *SpecialNumber) UniversalExpressionNames(ns Namespace) error
func (*SpecialNumber) Value ¶
func (t *SpecialNumber) Value() string
func (*SpecialNumber) Walk ¶
func (t *SpecialNumber) Walk(fn WalkFunc) error
func (*SpecialNumber) WriteExpression ¶
func (t *SpecialNumber) WriteExpression() string
type Statement ¶
type Statement interface { Token AddStatement(st Statement) // panics if Statement is not Block-like WriteStatement(usage Usage, indent string, nl string, tab string) string HoistNames(scope Scope) error ResolveStatementNames(scope Scope) error EvalStatement() error // usage is resolved in reverse order, so that unused 'mutations' (i.e. variable assignments) can be detected ResolveStatementActivity(usage Usage) error // universal names need to be registered before other unique names are generated UniversalStatementNames(ns Namespace) error UniqueStatementNames(ns Namespace) error // used be refactoring tools Walk(fn WalkFunc) error }
type StrictEqOp ¶
type StrictEqOp struct {
EqCompareOp
}
func (*StrictEqOp) EvalExpression ¶
func (t *StrictEqOp) EvalExpression() (values.Value, error)
func (*StrictEqOp) Walk ¶
func (t *StrictEqOp) Walk(fn WalkFunc) error
type StrictNEOp ¶
type StrictNEOp struct {
EqCompareOp
}
func (*StrictNEOp) EvalExpression ¶
func (t *StrictNEOp) EvalExpression() (values.Value, error)
func (*StrictNEOp) Walk ¶
func (t *StrictNEOp) Walk(fn WalkFunc) error
type Switch ¶
type Switch struct { Block // dont use the Block.statements // contains filtered or unexported fields }
func (*Switch) AddCase ¶
func (t *Switch) AddCase(clause Expression) error
func (*Switch) AddStatement ¶
func (*Switch) ConvertToIf ¶
func (*Switch) EvalStatement ¶
func (*Switch) HoistNames ¶
func (*Switch) ResolveStatementActivity ¶
func (*Switch) ResolveStatementNames ¶
func (*Switch) UniqueStatementNames ¶
func (*Switch) UniversalStatementNames ¶
type TemplateString ¶
type TemplateString struct { LiteralData // contains filtered or unexported fields }
func NewTemplateString ¶
func NewTemplateString(exprs []Expression, ctx context.Context) (*TemplateString, error)
func (*TemplateString) Dump ¶
func (t *TemplateString) Dump(indent string) string
func (*TemplateString) EvalExpression ¶
func (t *TemplateString) EvalExpression() (values.Value, error)
func (*TemplateString) ResolveExpressionActivity ¶
func (t *TemplateString) ResolveExpressionActivity(usage Usage) error
func (*TemplateString) ResolveExpressionNames ¶
func (t *TemplateString) ResolveExpressionNames(scope Scope) error
func (*TemplateString) UniqueExpressionNames ¶
func (t *TemplateString) UniqueExpressionNames(ns Namespace) error
func (*TemplateString) UniversalExpressionNames ¶
func (t *TemplateString) UniversalExpressionNames(ns Namespace) error
func (*TemplateString) Walk ¶
func (t *TemplateString) Walk(fn WalkFunc) error
func (*TemplateString) WriteExpression ¶
func (t *TemplateString) WriteExpression() string
type TernaryOp ¶
type TernaryOp struct { TokenData // contains filtered or unexported fields }
func (*TernaryOp) ResolveExpressionActivity ¶
func (*TernaryOp) ResolveExpressionNames ¶
func (*TernaryOp) UniqueExpressionNames ¶
func (*TernaryOp) UniversalExpressionNames ¶
func (*TernaryOp) WriteExpression ¶
type Throw ¶
type Throw struct { TokenData // contains filtered or unexported fields }
func (*Throw) AddStatement ¶
func (*Throw) EvalStatement ¶
func (*Throw) HoistNames ¶
func (*Throw) ResolveStatementActivity ¶
func (*Throw) ResolveStatementNames ¶
func (*Throw) UniqueStatementNames ¶
func (*Throw) UniversalStatementNames ¶
type TryCatch ¶
type TryCatch struct { Block // contains filtered or unexported fields }
func (*TryCatch) AddFinally ¶
func (*TryCatch) AddStatement ¶
func (*TryCatch) EvalStatement ¶
func (*TryCatch) HoistNames ¶
func (*TryCatch) ResolveStatementActivity ¶
func (*TryCatch) ResolveStatementNames ¶
func (*TryCatch) UniqueStatementNames ¶
func (*TryCatch) UniversalStatementNames ¶
type TypeExpression ¶
type TypeExpression struct { VarExpression // the base type will be a class variable // contains filtered or unexported fields }
very similar to VarExpression, but with extra
func GetTypeExpression ¶
func GetTypeExpression(expr_ Expression) (*TypeExpression, error)
func NewTypeExpression ¶
func NewTypeExpression(name string, parameterKeys []*Word, parameterTypes []*TypeExpression, ctx context.Context) (*TypeExpression, error)
func (*TypeExpression) Dump ¶
func (t *TypeExpression) Dump(indent string) string
func (*TypeExpression) EvalExpression ¶
func (t *TypeExpression) EvalExpression() (values.Value, error)
Acts as the new generate instance
func (*TypeExpression) ResolveExpressionNames ¶
func (t *TypeExpression) ResolveExpressionNames(scope Scope) error
func (*TypeExpression) Walk ¶
func (t *TypeExpression) Walk(fn WalkFunc) error
func (*TypeExpression) WriteUniversalRuntimeType ¶
func (t *TypeExpression) WriteUniversalRuntimeType() string
type TypeExpressionMember ¶
type TypeExpressionMember struct {
// contains filtered or unexported fields
}
func (*TypeExpressionMember) Walk ¶
func (t *TypeExpressionMember) Walk(fn WalkFunc) error
type TypeOfOp ¶
type TypeOfOp struct {
PreUnaryOp
}
type UnaryOp ¶
type UnaryOp struct { TokenData // contains filtered or unexported fields }
func (*UnaryOp) ResolveExpressionActivity ¶
func (*UnaryOp) ResolveExpressionNames ¶
func (*UnaryOp) UniqueExpressionNames ¶
func (*UnaryOp) UniversalExpressionNames ¶
type Usage ¶
type UsageData ¶
type UsageData struct {
// contains filtered or unexported fields
}
func (*UsageData) DetectUnused ¶
func (*UsageData) InFunction ¶
func (*UsageData) Rereference ¶
func (*UsageData) SetInFunction ¶
type UsageState ¶
type UsageState struct {
// contains filtered or unexported fields
}
type VarExpression ¶
type VarExpression struct { TokenData // contains filtered or unexported fields }
simply prints the variable name
func AssertVarExpression ¶
func AssertVarExpression(t Token) (*VarExpression, error)
func NewConstantVarExpression ¶
func NewConstantVarExpression(name string, ctx context.Context) *VarExpression
for Function and Class statements
func NewVarExpression ¶
func NewVarExpression(name string, ctx context.Context) *VarExpression
func (*VarExpression) Dump ¶
func (t *VarExpression) Dump(indent string) string
func (*VarExpression) EvalExpression ¶
func (t *VarExpression) EvalExpression() (values.Value, error)
as rhs
func (*VarExpression) GetInterface ¶
func (t *VarExpression) GetInterface() values.Interface
func (*VarExpression) GetPrototype ¶
func (t *VarExpression) GetPrototype() values.Prototype
func (*VarExpression) GetVariable ¶
func (t *VarExpression) GetVariable() Variable
func (*VarExpression) Name ¶
func (t *VarExpression) Name() string
func (*VarExpression) NonPackageContext ¶
func (t *VarExpression) NonPackageContext() context.Context
use by refactoring tools
func (*VarExpression) PackageContext ¶
func (t *VarExpression) PackageContext() context.Context
use by refactoring tools
func (*VarExpression) PackagePath ¶
func (t *VarExpression) PackagePath() string
func (*VarExpression) RefersToPackage ¶
func (t *VarExpression) RefersToPackage(absPath string) bool
func (*VarExpression) ResolveExpressionActivity ¶
func (t *VarExpression) ResolveExpressionActivity(usage Usage) error
func (*VarExpression) ResolveExpressionNames ¶
func (t *VarExpression) ResolveExpressionNames(scope Scope) error
func (*VarExpression) ToTypeExpression ¶
func (t *VarExpression) ToTypeExpression() (*TypeExpression, error)
func (*VarExpression) UniqueExpressionNames ¶
func (t *VarExpression) UniqueExpressionNames(ns Namespace) error
func (*VarExpression) UniversalExpressionNames ¶
func (t *VarExpression) UniversalExpressionNames(ns Namespace) error
func (*VarExpression) Walk ¶
func (t *VarExpression) Walk(fn WalkFunc) error
func (*VarExpression) WriteExpression ¶
func (t *VarExpression) WriteExpression() string
type VarStatement ¶
type VarStatement struct { TokenData // contains filtered or unexported fields }
func NewVarStatement ¶
func NewVarStatement(varType VarType, exprs []Expression, typeExprs []*TypeExpression, ctx context.Context) (*VarStatement, error)
func (*VarStatement) AddStatement ¶
func (t *VarStatement) AddStatement(st Statement)
func (*VarStatement) Dump ¶
func (t *VarStatement) Dump(indent string) string
func (*VarStatement) EvalStatement ¶
func (t *VarStatement) EvalStatement() error
func (*VarStatement) GetVariables ¶
func (t *VarStatement) GetVariables() map[string]Variable
func (*VarStatement) HoistNames ¶
func (t *VarStatement) HoistNames(scope Scope) error
func (*VarStatement) ResolveStatementActivity ¶
func (t *VarStatement) ResolveStatementActivity(usage Usage) error
func (*VarStatement) ResolveStatementNames ¶
func (t *VarStatement) ResolveStatementNames(scope Scope) error
func (*VarStatement) UniqueStatementNames ¶
func (t *VarStatement) UniqueStatementNames(ns Namespace) error
func (*VarStatement) UniversalStatementNames ¶
func (t *VarStatement) UniversalStatementNames(ns Namespace) error
func (*VarStatement) Walk ¶
func (t *VarStatement) Walk(fn WalkFunc) error
func (*VarStatement) WriteStatement ¶
type Variable ¶
type Variable interface { Context() context.Context Dump(indent string) string Name() string Rename(newName string) Constant() bool SetConstant() GetValue() values.Value SetValue(values.Value) // anything that can be evaluated during the resolve names stage (eg. class statement) GetObject() interface{} SetObject(interface{}) }
a Package also implements the Variable interface
type VariableData ¶
type VariableData struct { TokenData // contains filtered or unexported fields }
func NewVariable ¶
func NewVariable(name string, constant bool, ctx context.Context) *VariableData
func (*VariableData) Constant ¶
func (t *VariableData) Constant() bool
func (*VariableData) Dump ¶
func (t *VariableData) Dump(indent string) string
func (*VariableData) GetObject ¶
func (t *VariableData) GetObject() interface{}
func (*VariableData) GetValue ¶
func (t *VariableData) GetValue() values.Value
func (*VariableData) Name ¶
func (t *VariableData) Name() string
func (*VariableData) Rename ¶
func (t *VariableData) Rename(newName string)
TODO: do this directly in the Namespace
func (*VariableData) SetConstant ¶
func (t *VariableData) SetConstant()
func (*VariableData) SetObject ¶
func (t *VariableData) SetObject(ptr interface{})
func (*VariableData) SetValue ¶
func (t *VariableData) SetValue(v values.Value)
type Void ¶
type Void struct { TokenData // contains filtered or unexported fields }
func NewVoidStatement ¶
func NewVoidStatement(expr Expression, ctx context.Context) *Void
func (*Void) AddStatement ¶
func (*Void) EvalStatement ¶
func (*Void) HoistNames ¶
func (*Void) ResolveStatementActivity ¶
func (*Void) ResolveStatementNames ¶
func (*Void) UniqueStatementNames ¶
func (*Void) UniversalStatementNames ¶
type While ¶
type While struct { Block // contains filtered or unexported fields }
func (*While) EvalStatement ¶
func (*While) HoistNames ¶
func (*While) ResolveStatementActivity ¶
func (*While) ResolveStatementNames ¶
func (*While) UniqueStatementNames ¶
func (*While) UniversalStatementNames ¶
type Word ¶
type Word struct { TokenData // contains filtered or unexported fields }
eg. for key of dict essentially a string-context pair
func AssertWord ¶
Source Files
¶
- Assign.go
- Await.go
- Block.go
- BlockScope.go
- BranchScope.go
- Break.go
- Call.go
- CaseScope.go
- Class.go
- ClassFunction.go
- ClassMember.go
- ClassProperty.go
- ClassScope.go
- Continue.go
- Enum.go
- Export.go
- Expression.go
- For.go
- ForBlock.go
- ForIn.go
- ForInOf.go
- ForOf.go
- Function.go
- FunctionArgument.go
- FunctionInterface.go
- FunctionScope.go
- GlobalScope.go
- If.go
- Import.go
- Index.go
- InstanceOf.go
- Interface.go
- Literal.go
- LiteralArray.go
- LiteralBoolean.go
- LiteralFloat.go
- LiteralInt.go
- LiteralNull.go
- LiteralObject.go
- LiteralString.go
- LoopScope.go
- Member.go
- Module.go
- ModuleScope.go
- Namespace.go
- NodeJSImport.go
- Package.go
- Parens.go
- Return.go
- Scope.go
- SpecialNumber.go
- Statement.go
- SubScope.go
- Switch.go
- TemplateString.go
- Throw.go
- Token.go
- TryCatch.go
- TypeExpression.go
- TypeGuard.go
- Usage.go
- VarExpression.go
- VarStatement.go
- VarType.go
- Variable.go
- Void.go
- WalkFunc.go
- While.go
- Word.go
- globals.go
- hash.go
- operators.go