Documentation ¶
Index ¶
- Variables
- func Type(v Value) string
- type ArgumentScanner
- type Array
- func (a Array) Equals(other Value) bool
- func (a Array) Get(r *Runtime, key Value) Value
- func (Array) IsBool() bool
- func (Array) IsFloat() bool
- func (Array) IsFunction() bool
- func (Array) IsInt() bool
- func (Array) IsString() bool
- func (a Array) Iterator() Iterator
- func (a Array) SameAs(other Value) bool
- func (a Array) Set(r *Runtime, key, value Value)
- func (Array) ToBool() bool
- func (Array) ToFloat() float64
- func (Array) ToFunction() Function
- func (Array) ToInt() int64
- func (a Array) ToNative(ops ...ToNativeOption) interface{}
- func (a Array) ToNumber() Number
- func (a Array) ToString() string
- func (Array) Type() string
- type Bool
- func (b Bool) Equals(other Value) bool
- func (Bool) IsBool() bool
- func (Bool) IsFloat() bool
- func (Bool) IsFunction() bool
- func (Bool) IsInt() bool
- func (Bool) IsString() bool
- func (b Bool) SameAs(bv Value) bool
- func (b Bool) ToBool() bool
- func (b Bool) ToFloat() float64
- func (b Bool) ToFunction() Function
- func (b Bool) ToInt() int64
- func (b Bool) ToNative(...ToNativeOption) interface{}
- func (b Bool) ToNumber() Number
- func (b Bool) ToString() string
- type Callback
- type CompilerError
- type CompilerSyntaxError
- type ErrTooFewArguments
- type ErrTypeMismatch
- type ErrTypeNotSupported
- type ErrWithArgumentIndex
- type Float
- func (f Float) Equals(other Value) bool
- func (Float) IsBool() bool
- func (Float) IsFloat() bool
- func (Float) IsFunction() bool
- func (Float) IsInt() bool
- func (Float) IsString() bool
- func (f Float) SameAs(b Value) bool
- func (f Float) ToBool() bool
- func (f Float) ToFloat() float64
- func (f Float) ToFunction() Function
- func (f Float) ToInt() int64
- func (f Float) ToNative(...ToNativeOption) interface{}
- func (f Float) ToNumber() Number
- func (f Float) ToString() string
- type Function
- type FunctionCall
- type Global
- type Int
- func (i Int) Equals(other Value) bool
- func (Int) IsBool() bool
- func (Int) IsFloat() bool
- func (Int) IsFunction() bool
- func (Int) IsInt() bool
- func (Int) IsString() bool
- func (i Int) SameAs(b Value) bool
- func (i Int) ToBool() bool
- func (i Int) ToFloat() float64
- func (i Int) ToFunction() Function
- func (i Int) ToInt() int64
- func (i Int) ToNative(...ToNativeOption) interface{}
- func (i Int) ToNumber() Number
- func (i Int) ToString() string
- type Iterable
- type Iterator
- type Map
- func (m Map) Equals(other Value) bool
- func (m Map) Get(r *Runtime, key Value) Value
- func (Map) IsBool() bool
- func (Map) IsFloat() bool
- func (Map) IsFunction() bool
- func (Map) IsInt() bool
- func (Map) IsString() bool
- func (m Map) Iterator() Iterator
- func (m Map) SameAs(other Value) bool
- func (m Map) Set(r *Runtime, key, value Value)
- func (Map) ToBool() bool
- func (Map) ToFloat() float64
- func (Map) ToFunction() Function
- func (Map) ToInt() int64
- func (m Map) ToNative(ops ...ToNativeOption) interface{}
- func (m Map) ToNumber() Number
- func (Map) ToString() string
- func (Map) Type() string
- type Number
- type Program
- type Ref
- func (ref Ref) Equals(other Value) bool
- func (Ref) IsBool() bool
- func (Ref) IsFloat() bool
- func (r Ref) IsFunction() bool
- func (Ref) IsInt() bool
- func (Ref) IsString() bool
- func (ref Ref) SameAs(other Value) bool
- func (Ref) ToBool() bool
- func (Ref) ToFloat() float64
- func (r Ref) ToFunction() Function
- func (Ref) ToInt() int64
- func (r Ref) ToNative(...ToNativeOption) interface{}
- func (ref Ref) ToNumber() Number
- func (Ref) ToString() string
- type Runtime
- func (r *Runtime) Call(f Function, args ...Value) Value
- func (r *Runtime) Context() context.Context
- func (r *Runtime) Global() *Global
- func (r *Runtime) RunProgram(ctx context.Context, program *Program) (Value, error)
- func (r *Runtime) RunString(s string) (Value, error)
- func (r *Runtime) SetCyclesLimit(max int)
- func (r *Runtime) ToValue(i interface{}) Value
- type String
- func (s String) Equals(other Value) bool
- func (s String) Get(r *Runtime, key Value) Value
- func (String) IsBool() bool
- func (String) IsFloat() bool
- func (String) IsFunction() bool
- func (String) IsInt() bool
- func (String) IsString() bool
- func (s String) SameAs(b Value) bool
- func (s String) ToBool() bool
- func (s String) ToFloat() float64
- func (s String) ToFunction() Function
- func (s String) ToInt() int64
- func (s String) ToNative(...ToNativeOption) interface{}
- func (s String) ToNumber() Number
- func (s String) ToString() string
- type ToNativeOption
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ( True = Bool(true) False = Bool(false) )
View Source
var ( ErrStackOverflow = errors.New("stack overflow") ErrCyclesLimitExceeded = errors.New("cycles limit exceeded") )
View Source
var Null _Null
Functions ¶
Types ¶
type ArgumentScanner ¶ added in v0.0.4
type ArgumentScanner struct {
// contains filtered or unexported fields
}
func NewArgumentScanner ¶ added in v0.0.4
func NewArgumentScanner(fc FunctionCall) *ArgumentScanner
func (*ArgumentScanner) Scan ¶ added in v0.0.4
func (s *ArgumentScanner) Scan(values ...interface{}) error
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func NewArrayFromStringSlice ¶ added in v0.0.4
func (Array) IsFunction ¶ added in v0.0.4
func (Array) ToFunction ¶ added in v0.0.4
func (Array) ToNative ¶ added in v0.0.4
func (a Array) ToNative(ops ...ToNativeOption) interface{}
type Bool ¶
type Bool bool
func (Bool) IsFunction ¶
func (Bool) ToFunction ¶
func (Bool) ToNative ¶
func (b Bool) ToNative(...ToNativeOption) interface{}
type CompilerSyntaxError ¶
type CompilerSyntaxError struct {
CompilerError
}
func (*CompilerSyntaxError) Error ¶
func (e *CompilerSyntaxError) Error() string
type ErrTooFewArguments ¶ added in v0.0.4
type ErrTooFewArguments struct {
// contains filtered or unexported fields
}
func (*ErrTooFewArguments) Error ¶ added in v0.0.4
func (e *ErrTooFewArguments) Error() string
type ErrTypeMismatch ¶ added in v0.0.4
type ErrTypeMismatch struct {
// contains filtered or unexported fields
}
func (*ErrTypeMismatch) Error ¶ added in v0.0.4
func (e *ErrTypeMismatch) Error() string
type ErrTypeNotSupported ¶ added in v0.0.4
type ErrTypeNotSupported struct {
// contains filtered or unexported fields
}
func (*ErrTypeNotSupported) Error ¶ added in v0.0.4
func (e *ErrTypeNotSupported) Error() string
type ErrWithArgumentIndex ¶ added in v0.0.4
type ErrWithArgumentIndex struct { Err error // contains filtered or unexported fields }
func (*ErrWithArgumentIndex) Error ¶ added in v0.0.4
func (e *ErrWithArgumentIndex) Error() string
type Float ¶
type Float float64
func (Float) IsFunction ¶
func (Float) ToFunction ¶
func (Float) ToNative ¶
func (f Float) ToNative(...ToNativeOption) interface{}
type Function ¶
type Function interface { Value // contains filtered or unexported methods }
func CurriedFunctionFunc ¶ added in v0.0.4
func CurriedFunctionFunc(n int, f func(FunctionCall) Value) Function
func FunctionFunc ¶
func FunctionFunc(fun func(FunctionCall) Value) Function
type FunctionCall ¶
type Int ¶
type Int int64
func (Int) IsFunction ¶
func (Int) ToFunction ¶
func (Int) ToNative ¶
func (i Int) ToNative(...ToNativeOption) interface{}
type Iterator ¶
func GetIterator ¶ added in v0.0.4
type Map ¶
func (Map) IsFunction ¶
func (Map) ToFunction ¶
func (Map) ToNative ¶
func (m Map) ToNative(ops ...ToNativeOption) interface{}
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func (*Program) InstructionNumber ¶ added in v0.0.4
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
func (Ref) IsFunction ¶
func (Ref) ToFunction ¶
func (Ref) ToNative ¶
func (r Ref) ToNative(...ToNativeOption) interface{}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) RunProgram ¶
func (*Runtime) SetCyclesLimit ¶ added in v0.0.4
type String ¶
type String string
func (String) IsFunction ¶ added in v0.0.4
func (String) ToFunction ¶ added in v0.0.4
func (String) ToNative ¶ added in v0.0.4
func (s String) ToNative(...ToNativeOption) interface{}
type ToNativeOption ¶ added in v0.0.3
type ToNativeOption int
const (
SkipCircularReference ToNativeOption = 1 << iota
)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.