Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EvalFn func(program any, env *object.Environment) object.Object
EvalFn evaluates an AST program in the given environment.
View Source
var FormatCallStackFn func(stack []object.CallFrame) string
FormatCallStackFn formats a call stack trace for display.
View Source
var IsErrorFn func(obj object.Object) bool
IsErrorFn returns true if the object is an Error.
View Source
var NewLexerFn func(input string) any
NewLexerFn creates a new lexer for the given input string.
View Source
var NewParserFn func(lexer any) any
NewParserFn creates a new parser from a lexer.
View Source
var ObjectErrorStringFn func(obj object.Object) string
ObjectErrorStringFn extracts the error message from an Error object.
View Source
var ParseProgramFn func(parser any) (program any, errors []string)
ParseProgramFn calls ParseProgram on the parser and returns (program, errors).
View Source
var WithSecurityPolicyOverrideFn func(policy *object.SecurityPolicy, fn func() (object.Object, error)) (object.Object, error)
WithSecurityPolicyOverrideFn temporarily overrides the active security policy while running fn.
Functions ¶
func FormatParserErrors ¶
Types ¶
type PlaygroundOptions ¶
type PlaygroundResult ¶
type PlaygroundResult struct {
Output string `json:"output"`
Result string `json:"result"`
ResultTy string `json:"result_type"`
Error string `json:"error"`
ErrorKind string `json:"error_kind"`
Diagnostics []string `json:"diagnostics,omitempty"`
Artifacts []renderpkg.ResolvedArtifact `json:"artifacts,omitempty"`
Duration int64 `json:"duration_ms"`
}
func EvalForPlayground ¶
func EvalForPlayground(script string, opts PlaygroundOptions) PlaygroundResult
EvalForPlayground evaluates a script in a sandboxed playground context.
Click to show internal directories.
Click to hide internal directories.