Versions in this module Expand all Collapse all v0 v0.0.0 Aug 25, 2022 Changes in this version + var StdErr io.Writer + var StdOut io.Writer + type Config struct + BindForeignClassMethodFn func(vm VM, module, class string) (allocator func(VM), finalizer func(VM, interface{})) + BindForeignMethodFn func(vm VM, module, class, signature string, static bool) func(VM) + ErrorFn func(vm VM, err error) + HeapGrowthPercent int + InitialHeapSize uint + LoadModuleFn func(vm VM, name string) (src string, ok bool) + MinHeapSize uint + ResolveModuleFn func(vm VM, importer, name string) (newName string, ok bool) + WriteFn func(vm VM, message string) + type ErrorType int32 + const ErrorCompile + const ErrorRuntime + const ErrorStackTrace + type Handle struct + func (h *Handle) Call() InterpretResult + func (h *Handle) Free() + type InterpretResult int32 + const ResultCompileError + const ResultRuntimeError + const ResultSuccess + type Type int32 + const TypeBool + const TypeForeign + const TypeList + const TypeMap + const TypeNull + const TypeNum + const TypeString + const TypeUnknown + type VM struct + func NewVM(cfg Config) VM + func (vm VM) AbortError(err error) + func (vm VM) AbortFiber(slot int) + func (vm VM) Allocated() int + func (vm VM) Call(handle Handle) InterpretResult + func (vm VM) CollectGarbage() + func (vm VM) EnsureSlots(numSlots int) + func (vm VM) Exit() + func (vm VM) Free() + func (vm VM) GetBool(slot int) bool + func (vm VM) GetBytes(slot int, writer io.Writer) error + func (vm VM) GetForeign(slot int) any + func (vm VM) GetHandle(slot int) Handle + func (vm VM) GetListElement(listSlot, index, elementSlot int) + func (vm VM) GetMapValue(mapSlot, keySlot, valueSlot int) + func (vm VM) GetNum(slot int) float64 + func (vm VM) GetString(slot int) string + func (vm VM) GetVariable(module, name string, slot int) + func (vm VM) HasModule(module string) bool + func (vm VM) HasVariable(module, name string) bool + func (vm VM) InsertInList(listSlot, index, elementSlot int) + func (vm VM) Interpret(module, source string) InterpretResult + func (vm VM) ListCount(slot int) int + func (vm VM) MapCount(slot int) int + func (vm VM) MapHasKey(mapSlot, keySlot int) bool + func (vm VM) NewCallHandle(signature string) Handle + func (vm VM) ReleaseHandle(handle Handle) + func (vm VM) RemoveMapValue(mapSlot, keySlot, valueSlot int) + func (vm VM) SetBool(slot int, value bool) + func (vm VM) SetBytes(slot int, data []byte) + func (vm VM) SetHandle(slot int, handle Handle) + func (vm VM) SetListElement(listSlot, index, elementSlot int) + func (vm VM) SetMapValue(mapSlot, keySlot, valueSlot int) + func (vm VM) SetNewForeign(slot, classSlot int, obj interface{}) + func (vm VM) SetNewList(slot int) + func (vm VM) SetNewMap(slot int) + func (vm VM) SetNull(slot int) + func (vm VM) SetNum(slot int, value float64) + func (vm VM) SetString(slot int, value string) + func (vm VM) SetUserdata(data interface{}) + func (vm VM) SlotCount() int + func (vm VM) SlotType(slot int) Type + func (vm VM) UserData() any + func (vm VM) VersionNumber() int + func (vm VM) VersionString() string + func (vm VM) VersionTuple() [3]int + type WrenError struct + Line int + Message string + Module string + Type ErrorType + func (err WrenError) Error() string