Versions in this module Expand all Collapse all v1 v1.16.11 Aug 20, 2024 Changes in this version + var FuncTypes = []any + var MemoryBudget uint = 1e6 + func Run(program *Program, env any) (any, error) + type Function = func(params ...any) (any, error) + type Opcode byte + const OpAdd + const OpArray + const OpBegin + const OpCall + const OpCall0 + const OpCall1 + const OpCall2 + const OpCall3 + const OpCallBuiltin1 + const OpCallFast + const OpCallN + const OpCallSafe + const OpCallTyped + const OpCast + const OpContains + const OpCreate + const OpDecrementIndex + const OpDeref + const OpDivide + const OpEnd + const OpEndsWith + const OpEqual + const OpEqualInt + const OpEqualString + const OpExponent + const OpFalse + const OpFetch + const OpFetchField + const OpGetAcc + const OpGetCount + const OpGetIndex + const OpGetLen + const OpGroupBy + const OpIn + const OpIncrementCount + const OpIncrementIndex + const OpInt + const OpInvalid + const OpJump + const OpJumpBackward + const OpJumpIfEnd + const OpJumpIfFalse + const OpJumpIfNil + const OpJumpIfNotNil + const OpJumpIfTrue + const OpLen + const OpLess + const OpLessOrEqual + const OpLoadConst + const OpLoadEnv + const OpLoadFast + const OpLoadField + const OpLoadFunc + const OpLoadMethod + const OpLoadVar + const OpMap + const OpMatches + const OpMatchesConst + const OpMethod + const OpModulo + const OpMore + const OpMoreOrEqual + const OpMultiply + const OpNegate + const OpNil + const OpNot + const OpPointer + const OpPop + const OpProfileEnd + const OpProfileStart + const OpPush + const OpRange + const OpSetAcc + const OpSetIndex + const OpSlice + const OpSort + const OpSortBy + const OpStartsWith + const OpStore + const OpSubtract + const OpThrow + const OpTrue + type Program struct + Arguments []int + Bytecode []Opcode + Constants []any + func NewProgram(source file.Source, node ast.Node, locations []file.Location, variables int, ...) *Program + func (program *Program) Disassemble() string + func (program *Program) DisassembleWriter(w io.Writer) + func (program *Program) Locations() []file.Location + func (program *Program) Node() ast.Node + func (program *Program) Source() file.Source + type SafeFunction = func(params ...any) (any, uint, error) + type Scope struct + Acc any + Array reflect.Value + Count int + Index int + Len int + type Span struct + Children []*Span + Duration int64 + Expression string + Name string + func GetSpan(program *Program) *Span + type VM struct + Scopes []*Scope + Stack []any + Variables []any + func Debug() *VM + func (vm *VM) Position() chan int + func (vm *VM) Run(program *Program, env any) (_ any, err error) + func (vm *VM) Step()