Documentation
¶
Index ¶
- Variables
- func IsAny(v_ Value) bool
- func IsClass(v_ Value) bool
- func IsInstance(v_ Value) bool
- func IsLiteral(v_ Value) bool
- func PrototypeIsAncestorOf(parent Prototype, child Prototype) bool
- type Any
- func (v *Any) Check(other Value, ctx context.Context) error
- func (v *Any) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Any) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Any) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Any) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Any) TypeName() string
- type Class
- func (v *Class) Check(other_ Value, ctx context.Context) error
- func (v *Class) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Class) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Class) GetConstructorArgs() [][]Value
- func (v *Class) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Class) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Class) TypeName() string
- type ContextValue
- func (v *ContextValue) Check(v_ Value, ctx context.Context) error
- func (v *ContextValue) Context() context.Context
- func (v *ContextValue) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *ContextValue) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *ContextValue) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *ContextValue) LiteralBooleanValue() (bool, bool)
- func (v *ContextValue) LiteralIntValue() (int, bool)
- func (v *ContextValue) LiteralStringValue() (string, bool)
- func (v *ContextValue) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *ContextValue) TypeName() string
- type Enum
- func (v *Enum) Check(other_ Value, ctx context.Context) error
- func (v *Enum) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Enum) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Enum) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Enum) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Enum) TypeName() string
- type Function
- func NewCustomFunction(args []Value, ...) *Function
- func NewFunction(argsAndRet []Value, ctx context.Context) *Function
- func NewMethodLikeFunction(argsAndRet []Value, ctx context.Context) *Function
- func NewOverloadedCustomFunction(args [][]Value, ...) *Function
- func NewOverloadedFunction(argsAndRet [][]Value, ctx context.Context) *Function
- func NewOverloadedMethodLikeFunction(argsAndRet [][]Value, ctx context.Context) *Function
- func (v *Function) Check(other_ Value, ctx context.Context) error
- func (v *Function) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Function) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Function) GetArgs() [][]Value
- func (v *Function) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Function) IsVoid() bool
- func (v *Function) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Function) TypeName() string
- type Instance
- func (v *Instance) Check(other_ Value, ctx context.Context) error
- func (v *Instance) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Instance) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Instance) GetInterface() Interface
- func (v *Instance) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Instance) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Instance) TypeName() string
- type Interface
- type LiteralBooleanInstance
- type LiteralIntInstance
- type LiteralStringInstance
- type Package
- type Prototype
- type Super
- func (v *Super) Check(other_ Value, ctx context.Context) error
- func (v *Super) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *Super) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *Super) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *Super) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *Super) TypeName() string
- type This
- func (v *This) AssertTouched(key string, ctx context.Context) error
- func (v *This) Check(other_ Value, ctx context.Context) error
- func (v *This) EvalConstructor(args []Value, ctx context.Context) (Value, error)
- func (v *This) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error)
- func (v *This) GetMember(key string, includePrivate bool, ctx context.Context) (Value, error)
- func (v *This) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error
- func (v *This) TypeName() string
- type Value
- func CommonValue(vs []Value, ctx context.Context) Value
- func NewAll(ctx context.Context) Value
- func NewAny(ctx context.Context) Value
- func NewContextValue(val Value, ctx context.Context) Value
- func NewInstance(interf Interface, ctx context.Context) Value
- func NewLiteralBooleanInstance(interf Interface, b bool, ctx context.Context) Value
- func NewLiteralIntInstance(interf Interface, i int, ctx context.Context) Value
- func NewLiteralStringInstance(interf Interface, str string, ctx context.Context) Value
- func NewSuper(cl *Class, ctx context.Context) (Value, error)
- func RemoveLiteralness(v Value) Value
- func UnpackContextValue(val Value) Value
- type ValueData
Constants ¶
This section is empty.
Variables ¶
View Source
var VERBOSITY = 0
Functions ¶
func IsInstance ¶
func PrototypeIsAncestorOf ¶
Types ¶
type Any ¶
type Any struct {
ValueData
}
func (*Any) EvalConstructor ¶
func (*Any) EvalFunction ¶
type Class ¶
type Class struct { ValueData // contains filtered or unexported fields }
func NewCustomClass ¶
func NewUnconstructableClass ¶
func (*Class) EvalConstructor ¶
func (*Class) EvalFunction ¶
func (*Class) GetConstructorArgs ¶
type ContextValue ¶
type ContextValue struct {
// contains filtered or unexported fields
}
give a different context to a value
func (*ContextValue) Context ¶
func (v *ContextValue) Context() context.Context
func (*ContextValue) EvalConstructor ¶
func (*ContextValue) EvalFunction ¶
func (*ContextValue) LiteralBooleanValue ¶
func (v *ContextValue) LiteralBooleanValue() (bool, bool)
func (*ContextValue) LiteralIntValue ¶
func (v *ContextValue) LiteralIntValue() (int, bool)
func (*ContextValue) LiteralStringValue ¶
func (v *ContextValue) LiteralStringValue() (string, bool)
func (*ContextValue) TypeName ¶
func (v *ContextValue) TypeName() string
type Enum ¶
type Enum struct { ValueData // contains filtered or unexported fields }
func (*Enum) EvalConstructor ¶
func (*Enum) EvalFunction ¶
type Function ¶
type Function struct { ValueData // contains filtered or unexported fields }
func NewCustomFunction ¶
func NewCustomFunction(args []Value, fn func(args []Value, preferMethod bool, ctx_ context.Context) (Value, error), ctx context.Context) *Function
args dont contain return value in case fn is defined
func NewMethodLikeFunction ¶
func NewOverloadedFunction ¶
func (*Function) EvalConstructor ¶
func (*Function) EvalFunction ¶
type Instance ¶
type Instance struct { ValueData // contains filtered or unexported fields }
func AssertInstance ¶
func (*Instance) EvalConstructor ¶
func (*Instance) EvalFunction ¶
func (*Instance) GetInterface ¶
type Interface ¶
type Interface interface { Name() string Context() context.Context Check(other Interface, ctx context.Context) error // if true: can be exported to databases etc. IsUniversal() bool // for actual interfaces: all implementations need to be universal IsRPC() bool // // get extended interfaces in case of js.Interface, get implements interfaces in case of js.Class GetInterfaces() ([]Interface, error) // get all prototypes that implement this interface (actual prototypes dont need include themselves) (used by InstanceOf.Write()) GetPrototypes() ([]Prototype, error) // returns nil if it doesnt exist GetInstanceMember(key string, includePrivate bool, ctx context.Context) (Value, error) SetInstanceMember(key string, includePrivate bool, arg Value, ctx context.Context) error }
func GetInterface ¶
returns nil if not an Instance with an Interface
type LiteralBooleanInstance ¶
type LiteralBooleanInstance struct { Instance // contains filtered or unexported fields }
func (*LiteralBooleanInstance) Check ¶
func (v *LiteralBooleanInstance) Check(other_ Value, ctx context.Context) error
func (*LiteralBooleanInstance) LiteralBooleanValue ¶
func (v *LiteralBooleanInstance) LiteralBooleanValue() (bool, bool)
type LiteralIntInstance ¶
type LiteralIntInstance struct { Instance // contains filtered or unexported fields }
func (*LiteralIntInstance) Check ¶
func (v *LiteralIntInstance) Check(other_ Value, ctx context.Context) error
func (*LiteralIntInstance) LiteralIntValue ¶
func (v *LiteralIntInstance) LiteralIntValue() (int, bool)
type LiteralStringInstance ¶
type LiteralStringInstance struct { Instance // contains filtered or unexported fields }
func (*LiteralStringInstance) Check ¶
func (v *LiteralStringInstance) Check(other_ Value, ctx context.Context) error
func (*LiteralStringInstance) LiteralStringValue ¶
func (v *LiteralStringInstance) LiteralStringValue() (string, bool)
func (*LiteralStringInstance) TypeName ¶
func (v *LiteralStringInstance) TypeName() string
type Prototype ¶
type Prototype interface { Interface IsAbstract() bool IsFinal() bool // returns nil if it doesn't have a parent GetParent() (Prototype, error) // return nil if it doesnt exist GetClassMember(key string, includePrivate bool, ctx context.Context) (Value, error) // return nil if constructor doesn't exist GetClassValue() (*Class, error) }
func GetPrototype ¶
returns nil if not an Instance with an Interface
type Super ¶
type Super struct { ValueData // contains filtered or unexported fields }
used in constructor, to allow calling
func (*Super) EvalConstructor ¶
func (*Super) EvalFunction ¶
always acts as method
type This ¶
type This struct { ValueData // contains filtered or unexported fields }
so we can assert each property is touched during construction
func (*This) EvalConstructor ¶
func (*This) EvalFunction ¶
type Value ¶
type Value interface { Context() context.Context TypeName() string Check(other Value, ctx context.Context) error EvalConstructor(args []Value, ctx context.Context) (Value, error) EvalFunction(args []Value, preferMethod bool, ctx context.Context) (Value, error) // method returns nil Value GetMember(key string, includePrivate bool, ctx context.Context) (Value, error) SetMember(key string, includePrivate bool, arg Value, ctx context.Context) error LiteralBooleanValue() (bool, bool) LiteralIntValue() (int, bool) LiteralStringValue() (string, bool) }
func CommonValue ¶
TODO: use parent prototypes too
func NewLiteralIntInstance ¶
func RemoveLiteralness ¶
func UnpackContextValue ¶
type ValueData ¶
type ValueData struct {
// contains filtered or unexported fields
}
func (*ValueData) LiteralBooleanValue ¶
func (*ValueData) LiteralIntValue ¶
func (*ValueData) LiteralStringValue ¶
Click to show internal directories.
Click to hide internal directories.