Documentation
¶
Overview ¶
Separate runtime package for recursive imports
Index ¶
- type NativeFunction
- type Runtime
- func (runtime *Runtime) AddScope(scopename string)
- func (runtime *Runtime) ApplyToVariable(scopename string, varname string, ...) error
- func (runtime *Runtime) CurrentScope() string
- func (runtime *Runtime) ExitScope()
- func (runtime *Runtime) GetFunc(funcname string) NativeFunction
- func (runtime *Runtime) GetMethod(calledOnValue interface{}, methodname string) NativeFunction
- func (runtime *Runtime) GetVar(varname string) (interface{}, error)
- func (runtime *Runtime) SetArrayIndex(varname string, index int64, varval interface{})
- func (runtime *Runtime) SetFunc(funcname string, fn NativeFunction)
- func (runtime *Runtime) SetMethod(onType reflect.Type, methodname string, method NativeFunction)
- func (runtime *Runtime) SetVar(scopename string, varname string, varval interface{})
- func (runtime *Runtime) VarExists(varname string) (bool, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NativeFunction ¶
type Runtime ¶
type Runtime struct {
Scopes []string
// Scope names => Variable names => values
Vars map[string]map[string]interface{}
Funcs map[string]map[string]func(*Runtime, []interface{}) (interface{}, error)
Methods map[reflect.Type]map[string]func(*Runtime, []interface{}) (interface{}, error)
Stdout, Stderr io.Writer
Stdin io.Reader
}
TODO: scopes for if and loops, etc. TODO: allow a[1][1] ...
func (*Runtime) ApplyToVariable ¶
func (*Runtime) CurrentScope ¶
func (*Runtime) GetFunc ¶
func (runtime *Runtime) GetFunc(funcname string) NativeFunction
func (*Runtime) GetMethod ¶
func (runtime *Runtime) GetMethod(calledOnValue interface{}, methodname string) NativeFunction
func (*Runtime) SetArrayIndex ¶
func (*Runtime) SetFunc ¶
func (runtime *Runtime) SetFunc(funcname string, fn NativeFunction)
func (*Runtime) SetMethod ¶
func (runtime *Runtime) SetMethod(onType reflect.Type, methodname string, method NativeFunction)
Click to show internal directories.
Click to hide internal directories.