mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
* Rearrange opcodes * Refactor groupBy * Fix tests * Super opcodes for GroupBy * Refactor sortBy builtin * Fix sortBy bench
28 lines
411 B
Go
28 lines
411 B
Go
package vm
|
|
|
|
import (
|
|
"reflect"
|
|
)
|
|
|
|
type (
|
|
Function = func(params ...any) (any, error)
|
|
SafeFunction = func(params ...any) (any, uint, error)
|
|
)
|
|
|
|
var (
|
|
// MemoryBudget represents an upper limit of memory usage.
|
|
MemoryBudget uint = 1e6
|
|
|
|
errorType = reflect.TypeOf((*error)(nil)).Elem()
|
|
)
|
|
|
|
type Scope struct {
|
|
Array reflect.Value
|
|
Index int
|
|
Len int
|
|
Count int
|
|
Acc any
|
|
}
|
|
|
|
type groupBy = map[any][]any
|