Documentation
¶
Index ¶
- Constants
- Variables
- func Args(v ...Value) func() []Value
- func CanBeNil(v reflect.Value) bool
- func EnsureFuncParams(c *Context, funcName string, args []Value, rules ...ArgRule)
- func GetImportPaths() []string
- func IsUndefined(v Value) bool
- func MakeGoValueByArg(c *Context, val Value, typ reflect.Type) reflect.Value
- func NextTypeId() int
- func Nullish(v Value) bool
- type ArgRule
- type ArraySort
- type CanHash
- type CanLen
- type CanSetIndex
- type CanSetMember
- type ClassBuilder
- func (h *ClassBuilder) Build() ValueType
- func (h *ClassBuilder) Constructor(f func(*Context, ValueObject, []Value)) *ClassBuilder
- func (h *ClassBuilder) Method(name string, f func(*Context, ValueObject, []Value) Value, args ...string) *ClassBuilder
- func (h *ClassBuilder) StaticMethod(name string, f func(*Context, ValueObject, []Value) Value, args ...string) *ClassBuilder
- type CompareResult
- type Context
- func (c *Context) AddBlockDefer(callee Value, args []Value, optional bool)
- func (c *Context) AddDefer(callee Value, args []Value, optional bool)
- func (c *Context) AddModule(name string, val Value, modTime int64)
- func (c *Context) AssertArgNum(num, min, max int, funcName string)
- func (c *Context) AutoImport()
- func (c *Context) Clone() *Context
- func (c *Context) CloneFrames() (cur, funcRoot, root *contextFrame)
- func (c *Context) DebugLog(msg string, args ...interface{})
- func (c *Context) EnsureNotReadonly()
- func (c *Context) Eval(code string, force bool) Value
- func (c *Context) EvalConst(n IEval)
- func (c *Context) FindValue(name string) (Value, bool)
- func (c *Context) ForceSetLocalValue(name string, value Value)
- func (c *Context) GetCallable(value interface{}) (ValueCallable, bool)
- func (c *Context) GetModule(name string) (Value, int64)
- func (c *Context) GetPosition() (filename string, lineNum int)
- func (c *Context) ImportModule(modPath string, reloadIfNewer bool, importType string) Value
- func (c *Context) Invoke(calleeVal Value, this Value, getArgs func() []Value) bool
- func (c *Context) InvokeMethod(this Value, method string, getArgs func() []Value) Value
- func (c *Context) IsCallable(value Value) bool
- func (c *Context) IsInFunc() bool
- func (c *Context) IsModuleTop() bool
- func (c *Context) ModifyValue(name string, value Value)
- func (c *Context) MustArray(v Value, name ...string) ValueArray
- func (c *Context) MustBool(v Value, name ...string) bool
- func (c *Context) MustCallable(v Value, name ...string) ValueCallable
- func (c *Context) MustFloat(v Value, name ...string) float64
- func (c *Context) MustInt(v Value, name ...string) int64
- func (c *Context) MustObject(v Value, name ...string) ValueObject
- func (c *Context) MustStr(v Value, name ...string) string
- func (c *Context) PopStack()
- func (c *Context) PrintStack()
- func (c *Context) PushFuncStack(funcName string)
- func (c *Context) PushStack()
- func (c *Context) RaiseRuntimeError(msg string, args ...interface{})
- func (c *Context) Recover()
- func (c *Context) Reset(resetVars ...bool)
- func (c *Context) ReturnTrue() bool
- func (c *Context) RunDefers()
- func (c *Context) SetLocalValue(name string, value Value)
- func (c *Context) SetPosition(filename string, lineNum int)
- func (c *Context) StartThread(callee Value, this Value, args []Value) func() Value
- func (c *Context) ValuesEqual(v1, v2 Value) bool
- func (c *Context) ValuesGreater(v1, v2 Value) bool
- func (c *Context) ValuesGreaterEqual(v1, v2 Value) bool
- func (c *Context) ValuesLess(v1, v2 Value) bool
- func (c *Context) ValuesLessEqual(v1, v2 Value) bool
- func (c *Context) ValuesNotEqual(v1, v2 Value) bool
- type Exception
- type GoFunc
- type GoType
- func (t GoType) CompareTo(other Value, c *Context) CompareResult
- func (t GoType) GetArgNames(*Context) []string
- func (GoType) GetIndex(int, *Context) Value
- func (t GoType) GetMember(name string, c *Context) Value
- func (t GoType) GetName() string
- func (t GoType) GetRefs() []string
- func (t GoType) GoType() reflect.Type
- func (t GoType) Invoke(c *Context, this Value, args []Value)
- func (GoType) IsTrue() bool
- func (t GoType) ToGoValue() interface{}
- func (t GoType) ToString(*Context) string
- func (GoType) Type() ValueType
- type GoValue
- func (v GoValue) CompareTo(other Value, c *Context) CompareResult
- func (v GoValue) GetIndex(index int, c *Context) Value
- func (v GoValue) GetMember(key string, c *Context) Value
- func (v GoValue) GoType() reflect.Type
- func (v GoValue) IsTrue() bool
- func (v GoValue) Len() int
- func (v GoValue) ReflectedValue() reflect.Value
- func (v GoValue) SetIndex(index int, val Value, c *Context)
- func (v GoValue) SetMember(key string, val Value, c *Context)
- func (v GoValue) ToGoValue() interface{}
- func (v GoValue) ToString(*Context) string
- func (v GoValue) Type() ValueType
- type IEval
- type ModuleInfo
- type RuntimeError
- type Stack
- type Value
- func ExceptionToValue(e Exception, c *Context) Value
- func FromGoValue(v reflect.Value, c *Context) Value
- func GetValueByPath(c *Context, v Value, path string) Value
- func NewGoValue(v interface{}) Value
- func NewMapWithPairs(c *Context, kvs []Value) Value
- func NewReflectedGoValue(v reflect.Value) Value
- func NoArgs() []Value
- func Unbound(v Value) Value
- type ValueArray
- func (v ValueArray) CompareTo(other Value, c *Context) CompareResult
- func (v ValueArray) GetIndex(index int, c *Context) Value
- func (v ValueArray) GetMember(name string, c *Context) Value
- func (ValueArray) GoType() reflect.Type
- func (v ValueArray) IsTrue() bool
- func (v ValueArray) Len() int
- func (v ValueArray) PushBack(el Value)
- func (v ValueArray) SetIndex(index int, value Value, c *Context)
- func (v ValueArray) ToGoValue() interface{}
- func (v ValueArray) ToString(c *Context) string
- func (v ValueArray) Type() ValueType
- type ValueBase
- type ValueBigNum
- func (v ValueBigNum) CompareTo(other Value, c *Context) CompareResult
- func (ValueBigNum) GetIndex(int, *Context) Value
- func (v ValueBigNum) GetMember(name string, c *Context) Value
- func (v ValueBigNum) GoType() reflect.Type
- func (v ValueBigNum) IsTrue() bool
- func (v ValueBigNum) ToGoValue() interface{}
- func (v ValueBigNum) ToString(*Context) string
- func (ValueBigNum) Type() ValueType
- func (v ValueBigNum) Value() *big.Float
- type ValueBool
- func (v ValueBool) CompareTo(other Value, c *Context) CompareResult
- func (ValueBool) GetIndex(int, *Context) Value
- func (v ValueBool) GetMember(name string, c *Context) Value
- func (v ValueBool) GoType() reflect.Type
- func (v ValueBool) Hash() int64
- func (v ValueBool) IsTrue() bool
- func (v ValueBool) ToGoValue() interface{}
- func (v ValueBool) ToString(*Context) string
- func (ValueBool) Type() ValueType
- func (v ValueBool) Value() bool
- type ValueBoundMethod
- func (v ValueBoundMethod) CompareTo(other Value, c *Context) CompareResult
- func (v ValueBoundMethod) GetArgNames(c *Context) []string
- func (v ValueBoundMethod) GetIndex(index int, c *Context) Value
- func (v ValueBoundMethod) GetMember(name string, c *Context) Value
- func (v ValueBoundMethod) GetName() string
- func (v ValueBoundMethod) GoType() reflect.Type
- func (v ValueBoundMethod) Invoke(c *Context, thisVal Value, args []Value)
- func (v ValueBoundMethod) IsTrue() bool
- func (v ValueBoundMethod) ToGoValue() interface{}
- func (v ValueBoundMethod) ToString(c *Context) string
- func (v ValueBoundMethod) Type() ValueType
- type ValueBuiltinFunction
- func (f *ValueBuiltinFunction) CompareTo(other Value, c *Context) CompareResult
- func (f *ValueBuiltinFunction) GetArgNames(*Context) []string
- func (f *ValueBuiltinFunction) GetIndex(int, *Context) Value
- func (f *ValueBuiltinFunction) GetMember(name string, c *Context) Value
- func (f *ValueBuiltinFunction) GetName() string
- func (f *ValueBuiltinFunction) GetRefs() []string
- func (f *ValueBuiltinFunction) GoType() reflect.Type
- func (f *ValueBuiltinFunction) Invoke(c *Context, thisArg Value, args []Value)
- func (f *ValueBuiltinFunction) IsTrue() bool
- func (f *ValueBuiltinFunction) ToGoValue() interface{}
- func (f *ValueBuiltinFunction) ToString(*Context) string
- func (f *ValueBuiltinFunction) Type() ValueType
- type ValueBytes
- func (v ValueBytes) CompareTo(other Value, c *Context) CompareResult
- func (v ValueBytes) GetIndex(index int, c *Context) Value
- func (v ValueBytes) GetMember(name string, c *Context) Value
- func (v ValueBytes) GoType() reflect.Type
- func (v ValueBytes) IsTrue() bool
- func (v ValueBytes) Len() int
- func (v ValueBytes) SetIndex(index int, value Value, c *Context)
- func (v ValueBytes) ToGoValue() interface{}
- func (v ValueBytes) ToString(*Context) string
- func (ValueBytes) Type() ValueType
- func (v ValueBytes) Value() []byte
- type ValueCallable
- type ValueFloat
- func (v ValueFloat) CompareTo(other Value, c *Context) CompareResult
- func (ValueFloat) GetIndex(int, *Context) Value
- func (v ValueFloat) GetMember(name string, c *Context) Value
- func (v ValueFloat) GoType() reflect.Type
- func (v ValueFloat) Hash() int64
- func (v ValueFloat) IsTrue() bool
- func (v ValueFloat) ToGoValue() interface{}
- func (v ValueFloat) ToString(*Context) string
- func (ValueFloat) Type() ValueType
- func (v ValueFloat) Value() float64
- type ValueFunc
- func (v *ValueFunc) CloneWithEnv(c *Context) *ValueFunc
- func (v *ValueFunc) CompareTo(other Value, c *Context) CompareResult
- func (v *ValueFunc) GetArgNames(*Context) []string
- func (v *ValueFunc) GetIndex(index int, c *Context) Value
- func (v *ValueFunc) GetMember(name string, c *Context) Value
- func (v *ValueFunc) GetName() string
- func (v *ValueFunc) GoType() reflect.Type
- func (v *ValueFunc) Invoke(c *Context, thisArg Value, args []Value)
- func (v *ValueFunc) IsTrue() bool
- func (v *ValueFunc) ToGoValue() interface{}
- func (v *ValueFunc) ToString(*Context) string
- func (v *ValueFunc) Type() ValueType
- type ValueInt
- func (v ValueInt) AsInt() int
- func (v ValueInt) CompareTo(other Value, c *Context) CompareResult
- func (ValueInt) GetIndex(int, *Context) Value
- func (v ValueInt) GetMember(name string, c *Context) Value
- func (v ValueInt) GoType() reflect.Type
- func (v ValueInt) Hash() int64
- func (v ValueInt) IsTrue() bool
- func (v ValueInt) ToGoValue() interface{}
- func (v ValueInt) ToString(*Context) string
- func (ValueInt) Type() ValueType
- func (v ValueInt) Value() int64
- type ValueMap
- func (m ValueMap) CompareTo(other Value, c *Context) CompareResult
- func (m ValueMap) Each(handle func(key, value Value) bool)
- func (m ValueMap) GetIndex(int, *Context) Value
- func (m ValueMap) GetMember(name string, c *Context) Value
- func (m ValueMap) GoType() reflect.Type
- func (m ValueMap) IsTrue() bool
- func (m ValueMap) Len() int
- func (m ValueMap) ToGoValue() interface{}
- func (m ValueMap) ToString(c *Context) string
- func (m ValueMap) Type() ValueType
- type ValueNil
- func (ValueNil) CompareTo(other Value, c *Context) CompareResult
- func (ValueNil) GetIndex(int, *Context) Value
- func (v ValueNil) GetMember(name string, c *Context) Value
- func (v ValueNil) GoType() reflect.Type
- func (ValueNil) IsTrue() bool
- func (ValueNil) ToGoValue() interface{}
- func (ValueNil) ToString(*Context) string
- func (ValueNil) Type() ValueType
- type ValueObject
- func (v ValueObject) CompareTo(other Value, c *Context) CompareResult
- func (v ValueObject) Each(f func(string, Value) bool)
- func (ValueObject) GetArgNames(*Context) []string
- func (v ValueObject) GetIndex(index int, c *Context) Value
- func (v ValueObject) GetMember(name string, c *Context) Value
- func (v ValueObject) GetName() string
- func (ValueObject) GetRefs() []string
- func (v ValueObject) GoType() reflect.Type
- func (v *ValueObject) Init(c *Context, args []Value)
- func (v ValueObject) Invoke(c *Context, this Value, args []Value)
- func (v ValueObject) IsTrue() (isTrue bool)
- func (v ValueObject) Iterate(f func(key string, value Value))
- func (v ValueObject) Len() int
- func (v ValueObject) SetMember(name string, value Value, c *Context)
- func (v *ValueObject) Super(fromType ValueType) ValueObject
- func (v ValueObject) ToGoValue() interface{}
- func (v ValueObject) ToString(c *Context) string
- func (v ValueObject) Type() ValueType
- type ValueSet
- func (m ValueSet) CompareTo(other Value, c *Context) CompareResult
- func (m ValueSet) Each(handle func(key, value Value) bool)
- func (m ValueSet) GetIndex(int, *Context) Value
- func (m ValueSet) GetMember(name string, c *Context) Value
- func (m ValueSet) GoType() reflect.Type
- func (m ValueSet) IsTrue() bool
- func (m ValueSet) Len() int
- func (m ValueSet) ToGoValue() interface{}
- func (m ValueSet) ToString(c *Context) string
- func (m ValueSet) Type() ValueType
- type ValueStr
- func (v ValueStr) CompareTo(other Value, c *Context) CompareResult
- func (v ValueStr) GetIndex(index int, c *Context) Value
- func (v ValueStr) GetMember(name string, c *Context) Value
- func (v ValueStr) GoType() reflect.Type
- func (v ValueStr) Hash() int64
- func (v ValueStr) IsTrue() bool
- func (v ValueStr) Len() int
- func (v ValueStr) Runes() []rune
- func (v ValueStr) ToGoValue() interface{}
- func (v ValueStr) ToString(*Context) string
- func (ValueStr) Type() ValueType
- func (v ValueStr) Value() string
- type ValueType
- type ValueUndefined
- func (ValueUndefined) CompareTo(other Value, c *Context) CompareResult
- func (ValueUndefined) GetIndex(int, *Context) Value
- func (v ValueUndefined) GetMember(name string, c *Context) Value
- func (ValueUndefined) GoType() reflect.Type
- func (ValueUndefined) IsTrue() bool
- func (ValueUndefined) ToGoValue() interface{}
- func (ValueUndefined) ToString(*Context) string
- func (ValueUndefined) Type() ValueType
Constants ¶
View Source
const ( ImportTypeScript = "script" ImportTypeText = "text" ImportTypeBytes = "bytes" ImportTypeCsv = "csv" ImportTypeJson = "json" )
Variables ¶
View Source
var ( TypeUndefined = NewType(builtinTypeUndefined, "Undefined") TypeNil = NewType(builtinTypeNil, "Nil") TypeInt = NewType(builtinTypeInt, "Int") TypeBigNum = NewType(builtinTypeBigNum, "BigNum") TypeFloat = NewType(builtinTypeFloat, "Float") TypeBool = NewType(builtinTypeBool, "Bool") TypeStr = NewType(builtinTypeStr, "Str") TypeBytes = NewType(builtinTypeBytes, "Bytes") TypeFunc = NewType(builtinTypeFunc, "Func") TypeArray = NewType(builtinTypeArray, "Array") TypeObject = NewType(builtinTypeObject, "Object") TypeMap = NewTypeWithCreator(builtinTypeObject, "Map", NewMapWithPairs) TypeType = NewType(builtinTypeType, "Type") TypeGoValue = NewType(builtinTypeGoValue, "GoValue") TypeGoType = NewType(builtinTypeGoType, "GoType") // Any Types TypeCallable = NewType(builtinTypeCallable, "AnyCallable") TypeAny = NewType(builtinTypeAny, "Any") )
View Source
var (
CantRunInReadonlyMode = errors.New("Cannot run in readonly mode")
)
View Source
var MakeMember = makeMember
View Source
var ToGoValue = toGoValue
Functions ¶
func EnsureFuncParams ¶
func GetImportPaths ¶
func GetImportPaths() []string
func IsUndefined ¶
func MakeGoValueByArg ¶
func NextTypeId ¶
func NextTypeId() int
Types ¶
type ArgRule ¶
type ArgRule interface {
// contains filtered or unexported methods
}
func ArgRuleOneOf ¶
func ArgRuleOptional ¶
func ArgRuleRequired ¶
type ArraySort ¶
type ArraySort struct { Array ValueArray LessFn ValueCallable Context *Context }
type CanSetIndex ¶
type CanSetMember ¶
type ClassBuilder ¶
type ClassBuilder struct {
// contains filtered or unexported fields
}
func NewClassBuilder ¶
func NewClassBuilder(name string, bases ...ValueType) *ClassBuilder
func (*ClassBuilder) Build ¶
func (h *ClassBuilder) Build() ValueType
func (*ClassBuilder) Constructor ¶
func (h *ClassBuilder) Constructor(f func(*Context, ValueObject, []Value)) *ClassBuilder
func (*ClassBuilder) Method ¶
func (h *ClassBuilder) Method(name string, f func(*Context, ValueObject, []Value) Value, args ...string) *ClassBuilder
func (*ClassBuilder) StaticMethod ¶ added in v1.0.4
func (h *ClassBuilder) StaticMethod(name string, f func(*Context, ValueObject, []Value) Value, args ...string) *ClassBuilder
type CompareResult ¶
type CompareResult int
const ( CompareResultNotEqual CompareResult = 0 CompareResultEqual CompareResult = 1 CompareResultLess CompareResult = 2 CompareResultGreater CompareResult = 4 )
type Context ¶
type Context struct { IsDebug bool Path string ImportPaths []string Args []string RetVal Value Breaking bool BreakingLabel string Stdout io.Writer Stderr io.Writer Stdin io.Reader Continuing bool ContinuingLabel string Returned bool ExportValue ValueObject ImportFunc func(*Context, string, string, string, bool) (Value, int64, bool) CanEval bool // contains filtered or unexported fields }
func NewContext ¶
func (*Context) AddBlockDefer ¶
func (*Context) AssertArgNum ¶
func (*Context) AutoImport ¶
func (c *Context) AutoImport()
func (*Context) CloneFrames ¶
func (c *Context) CloneFrames() (cur, funcRoot, root *contextFrame)
func (*Context) EnsureNotReadonly ¶ added in v1.0.12
func (c *Context) EnsureNotReadonly()
func (*Context) ForceSetLocalValue ¶
func (*Context) GetCallable ¶ added in v1.0.8
func (c *Context) GetCallable(value interface{}) (ValueCallable, bool)
func (*Context) GetPosition ¶ added in v1.0.4
func (*Context) ImportModule ¶
func (*Context) InvokeMethod ¶
func (*Context) IsCallable ¶
func (*Context) IsModuleTop ¶
func (*Context) ModifyValue ¶
func (*Context) MustCallable ¶
func (c *Context) MustCallable(v Value, name ...string) ValueCallable
func (*Context) MustObject ¶
func (c *Context) MustObject(v Value, name ...string) ValueObject
func (*Context) PrintStack ¶
func (c *Context) PrintStack()
func (*Context) PushFuncStack ¶
func (*Context) RaiseRuntimeError ¶ added in v1.0.4
func (*Context) SetLocalValue ¶
func (*Context) SetPosition ¶
func (*Context) StartThread ¶
func (*Context) ValuesEqual ¶
func (*Context) ValuesGreater ¶
func (*Context) ValuesGreaterEqual ¶
func (*Context) ValuesLess ¶
func (*Context) ValuesLessEqual ¶
func (*Context) ValuesNotEqual ¶
type GoFunc ¶
type GoFunc struct { GoValue // contains filtered or unexported fields }
func (GoFunc) GetArgNames ¶
type GoValue ¶
type GoValue struct { *ValueBase // contains filtered or unexported fields }
func (GoValue) ReflectedValue ¶
type ModuleInfo ¶
type RuntimeError ¶
func (*RuntimeError) Error ¶
func (e *RuntimeError) Error() string
func (*RuntimeError) GetMessage ¶
func (e *RuntimeError) GetMessage() string
func (*RuntimeError) GetStack ¶
func (e *RuntimeError) GetStack() []Stack
func (*RuntimeError) MessageWithStack ¶
func (e *RuntimeError) MessageWithStack() string
type Value ¶
type Value interface { GetOwner() Value SetOwner(Value) Type() ValueType CompareTo(Value, *Context) CompareResult ToString(*Context) string ToGoValue() interface{} GoType() reflect.Type IsTrue() bool GetIndex(int, *Context) Value GetMember(string, *Context) Value }
func ExceptionToValue ¶
func NewGoValue ¶
func NewGoValue(v interface{}) Value
func NewMapWithPairs ¶ added in v1.0.13
func NewReflectedGoValue ¶
type ValueArray ¶
func NewArray ¶
func NewArray(n ...int) ValueArray
func NewArrayByValues ¶
func NewArrayByValues(values ...Value) ValueArray
func (ValueArray) CompareTo ¶
func (v ValueArray) CompareTo(other Value, c *Context) CompareResult
func (ValueArray) GoType ¶
func (ValueArray) GoType() reflect.Type
func (ValueArray) IsTrue ¶
func (v ValueArray) IsTrue() bool
func (ValueArray) Len ¶
func (v ValueArray) Len() int
func (ValueArray) PushBack ¶
func (v ValueArray) PushBack(el Value)
func (ValueArray) ToGoValue ¶
func (v ValueArray) ToGoValue() interface{}
func (ValueArray) ToString ¶
func (v ValueArray) ToString(c *Context) string
func (ValueArray) Type ¶
func (v ValueArray) Type() ValueType
type ValueBigNum ¶
type ValueBigNum struct { *ValueBase // contains filtered or unexported fields }
func NewBigNum ¶
func NewBigNum(v *big.Float) ValueBigNum
func (ValueBigNum) CompareTo ¶
func (v ValueBigNum) CompareTo(other Value, c *Context) CompareResult
func (ValueBigNum) GoType ¶
func (v ValueBigNum) GoType() reflect.Type
func (ValueBigNum) IsTrue ¶
func (v ValueBigNum) IsTrue() bool
func (ValueBigNum) ToGoValue ¶
func (v ValueBigNum) ToGoValue() interface{}
func (ValueBigNum) ToString ¶
func (v ValueBigNum) ToString(*Context) string
func (ValueBigNum) Type ¶
func (ValueBigNum) Type() ValueType
func (ValueBigNum) Value ¶
func (v ValueBigNum) Value() *big.Float
type ValueBoundMethod ¶
type ValueBoundMethod struct { *ValueBase Value ValueCallable }
func NewBoundMethod ¶
func NewBoundMethod(owner Value, value ValueCallable) ValueBoundMethod
func (ValueBoundMethod) CompareTo ¶
func (v ValueBoundMethod) CompareTo(other Value, c *Context) CompareResult
func (ValueBoundMethod) GetArgNames ¶
func (v ValueBoundMethod) GetArgNames(c *Context) []string
func (ValueBoundMethod) GetMember ¶
func (v ValueBoundMethod) GetMember(name string, c *Context) Value
func (ValueBoundMethod) GetName ¶
func (v ValueBoundMethod) GetName() string
func (ValueBoundMethod) GoType ¶
func (v ValueBoundMethod) GoType() reflect.Type
func (ValueBoundMethod) Invoke ¶
func (v ValueBoundMethod) Invoke(c *Context, thisVal Value, args []Value)
func (ValueBoundMethod) IsTrue ¶
func (v ValueBoundMethod) IsTrue() bool
func (ValueBoundMethod) ToGoValue ¶
func (v ValueBoundMethod) ToGoValue() interface{}
func (ValueBoundMethod) ToString ¶
func (v ValueBoundMethod) ToString(c *Context) string
func (ValueBoundMethod) Type ¶
func (v ValueBoundMethod) Type() ValueType
type ValueBuiltinFunction ¶
type ValueBuiltinFunction struct { ValueBase // contains filtered or unexported fields }
func NewNativeFunction ¶
func WrapGoFunction ¶
func WrapGoFunction(f interface{}) *ValueBuiltinFunction
func (*ValueBuiltinFunction) CompareTo ¶
func (f *ValueBuiltinFunction) CompareTo(other Value, c *Context) CompareResult
func (*ValueBuiltinFunction) GetArgNames ¶
func (f *ValueBuiltinFunction) GetArgNames(*Context) []string
func (*ValueBuiltinFunction) GetIndex ¶
func (f *ValueBuiltinFunction) GetIndex(int, *Context) Value
func (*ValueBuiltinFunction) GetMember ¶
func (f *ValueBuiltinFunction) GetMember(name string, c *Context) Value
func (*ValueBuiltinFunction) GetName ¶
func (f *ValueBuiltinFunction) GetName() string
func (*ValueBuiltinFunction) GetRefs ¶
func (f *ValueBuiltinFunction) GetRefs() []string
func (*ValueBuiltinFunction) GoType ¶
func (f *ValueBuiltinFunction) GoType() reflect.Type
func (*ValueBuiltinFunction) Invoke ¶
func (f *ValueBuiltinFunction) Invoke(c *Context, thisArg Value, args []Value)
func (*ValueBuiltinFunction) IsTrue ¶
func (f *ValueBuiltinFunction) IsTrue() bool
func (*ValueBuiltinFunction) ToGoValue ¶
func (f *ValueBuiltinFunction) ToGoValue() interface{}
func (*ValueBuiltinFunction) ToString ¶
func (f *ValueBuiltinFunction) ToString(*Context) string
func (*ValueBuiltinFunction) Type ¶
func (f *ValueBuiltinFunction) Type() ValueType
type ValueBytes ¶
type ValueBytes struct { *ValueBase // contains filtered or unexported fields }
func NewBytes ¶
func NewBytes(v []byte) ValueBytes
func (ValueBytes) CompareTo ¶
func (v ValueBytes) CompareTo(other Value, c *Context) CompareResult
func (ValueBytes) GoType ¶
func (v ValueBytes) GoType() reflect.Type
func (ValueBytes) IsTrue ¶
func (v ValueBytes) IsTrue() bool
func (ValueBytes) Len ¶
func (v ValueBytes) Len() int
func (ValueBytes) ToGoValue ¶
func (v ValueBytes) ToGoValue() interface{}
func (ValueBytes) ToString ¶
func (v ValueBytes) ToString(*Context) string
func (ValueBytes) Type ¶
func (ValueBytes) Type() ValueType
func (ValueBytes) Value ¶
func (v ValueBytes) Value() []byte
type ValueCallable ¶
type ValueFloat ¶
type ValueFloat struct { *ValueBase // contains filtered or unexported fields }
func NewFloat ¶
func NewFloat(v float64) ValueFloat
func (ValueFloat) CompareTo ¶
func (v ValueFloat) CompareTo(other Value, c *Context) CompareResult
func (ValueFloat) GoType ¶
func (v ValueFloat) GoType() reflect.Type
func (ValueFloat) Hash ¶ added in v1.0.13
func (v ValueFloat) Hash() int64
func (ValueFloat) IsTrue ¶
func (v ValueFloat) IsTrue() bool
func (ValueFloat) ToGoValue ¶
func (v ValueFloat) ToGoValue() interface{}
func (ValueFloat) ToString ¶
func (v ValueFloat) ToString(*Context) string
func (ValueFloat) Type ¶
func (ValueFloat) Type() ValueType
func (ValueFloat) Value ¶
func (v ValueFloat) Value() float64
type ValueFunc ¶
type ValueFunc struct { *ValueBase Name string Args []string ExpandLast bool This Value Body IEval BelongType ValueType // contains filtered or unexported fields }
func (*ValueFunc) CloneWithEnv ¶
func (*ValueFunc) GetArgNames ¶
type ValueMap ¶ added in v1.0.13
type ValueMap = *valueMap
func (ValueMap) CompareTo ¶ added in v1.0.13
func (m ValueMap) CompareTo(other Value, c *Context) CompareResult
type ValueObject ¶
type ValueObject struct { *ValueBase // contains filtered or unexported fields }
func NewObject ¶
func NewObject(objType ...ValueType) ValueObject
func NewObjectAndInit ¶
func NewObjectAndInit(objType ValueType, c *Context, initArgs ...Value) ValueObject
func (ValueObject) CompareTo ¶
func (v ValueObject) CompareTo(other Value, c *Context) CompareResult
func (ValueObject) GetArgNames ¶
func (ValueObject) GetArgNames(*Context) []string
func (ValueObject) GetName ¶
func (v ValueObject) GetName() string
func (ValueObject) GetRefs ¶
func (ValueObject) GetRefs() []string
func (ValueObject) GoType ¶
func (v ValueObject) GoType() reflect.Type
func (*ValueObject) Init ¶
func (v *ValueObject) Init(c *Context, args []Value)
func (ValueObject) IsTrue ¶
func (v ValueObject) IsTrue() (isTrue bool)
func (ValueObject) Iterate ¶
func (v ValueObject) Iterate(f func(key string, value Value))
func (ValueObject) Len ¶
func (v ValueObject) Len() int
func (*ValueObject) Super ¶
func (v *ValueObject) Super(fromType ValueType) ValueObject
func (ValueObject) ToGoValue ¶
func (v ValueObject) ToGoValue() interface{}
func (ValueObject) ToString ¶
func (v ValueObject) ToString(c *Context) string
func (ValueObject) Type ¶
func (v ValueObject) Type() ValueType
type ValueSet ¶ added in v1.0.13
type ValueSet = *valueSet
func (ValueSet) CompareTo ¶ added in v1.0.13
func (m ValueSet) CompareTo(other Value, c *Context) CompareResult
type ValueStr ¶
type ValueStr struct { *ValueBase // contains filtered or unexported fields }
func NewStrByRunes ¶
type ValueUndefined ¶
type ValueUndefined struct {
*ValueBase
}
func Undefined ¶
func Undefined() ValueUndefined
func (ValueUndefined) CompareTo ¶
func (ValueUndefined) CompareTo(other Value, c *Context) CompareResult
func (ValueUndefined) GoType ¶
func (ValueUndefined) GoType() reflect.Type
func (ValueUndefined) IsTrue ¶
func (ValueUndefined) IsTrue() bool
func (ValueUndefined) ToGoValue ¶
func (ValueUndefined) ToGoValue() interface{}
func (ValueUndefined) ToString ¶
func (ValueUndefined) ToString(*Context) string
func (ValueUndefined) Type ¶
func (ValueUndefined) Type() ValueType
Source Files
¶
- builtin_functions.go
- builtin_types.go
- builtins.go
- context.go
- errors.go
- go_bridge.go
- go_values.go
- types.go
- utils.go
- value.go
- value_array.go
- value_array_groupby.go
- value_bignum.go
- value_bool.go
- value_bound.go
- value_bytes.go
- value_callable.go
- value_float.go
- value_func.go
- value_int.go
- value_map.go
- value_nil.go
- value_object.go
- value_set.go
- value_str.go
- value_type.go
- value_undefined.go
Click to show internal directories.
Click to hide internal directories.