Documentation
¶
Index ¶
- func FormatErrorWithTextPosition(err error, rawText string) string
- func ShowErrorLine(rawText string, posInt int) string
- type CompileOption
- type Label
- type LazyString
- type SExpressions
- type StructLabel
- type VM
- func (v *VM) CodeString() string
- func (v *VM) Copy() VM
- func (vm *VM) Env(k Label, v any)
- func (vm *VM) EnvFloat32(k string, v float32)
- func (vm *VM) EnvFloat64(k string, v float64)
- func (vm *VM) EnvInt(k string, v int)
- func (vm *VM) EnvInt64(k string, v int64)
- func (vm *VM) EnvString(k string, v string)
- func (v *VM) Execute(ctx context.Context) (errRes error)
- func (v *VM) Reset()
- func (v *VM) Result() any
- func (v *VM) Stop()
- func (vm *VM) WithMaxStackSize(sizeInBytes uint64) *VM
- func (vm *VM) WithTimeout(timeout time.Duration) *VM
- type VMByteCode
- type ValuePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShowErrorLine ¶
Types ¶
type CompileOption ¶
type CompileOption func(bt *VMByteCode)
func EnableDebugSymbols ¶
func EnableDebugSymbols() CompileOption
func EnvVariables ¶
func EnvVariables(env ...Label) CompileOption
func ExtFunctions ¶
func ExtFunctions(funcs map[string]any) (CompileOption, error)
func ExtFunctionsOrPanic ¶
func ExtFunctionsOrPanic(funcs map[string]any) CompileOption
type LazyString ¶
type LazyString func() string
func (LazyString) String ¶
func (ls LazyString) String() string
type SExpressions ¶
type SExpressions []any
func Read ¶
func Read(sourceCode string) (SExpressions, error)
type StructLabel ¶
type StructLabel string
func (StructLabel) String ¶
func (l StructLabel) String() string
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func NewVM ¶
func NewVM(output *VMByteCode) *VM
func (*VM) CodeString ¶
func (*VM) EnvFloat32 ¶
func (*VM) EnvFloat64 ¶
func (*VM) WithMaxStackSize ¶
type VMByteCode ¶
type VMByteCode struct {
// contains filtered or unexported fields
}
func Compile ¶
func Compile(ctx context.Context, text string, options ...CompileOption) (_ *VMByteCode, err error)
func (*VMByteCode) ImportedEnvVariables ¶
func (v *VMByteCode) ImportedEnvVariables() []string
func (*VMByteCode) ImportedExternalFunctions ¶
func (v *VMByteCode) ImportedExternalFunctions() []string
Click to show internal directories.
Click to hide internal directories.