Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyFunction(ctx context.Context, fn object.Object, args []object.Object, ...) object.Object
- func ContextWithCallDepth(ctx context.Context, maxDepth int) context.Context
- func ContextWithSourceFile(ctx context.Context, filename string) context.Context
- func Eval(node ast.Node, env *object.Environment) object.Object
- func EvalWithContext(ctx context.Context, node ast.Node, env *object.Environment) object.Object
- func GetEnvFromContext(ctx context.Context) *object.Environment
- func GetImportBuiltin() *object.Builtin
- func GetSourceFileFromContext(ctx context.Context) string
- func SetCallDepthInContext(ctx context.Context, cd *CallDepth) context.Context
- func SetEnvInContext(ctx context.Context, env *object.Environment) context.Context
- func WithEvaluator(ctx context.Context) context.Context
- type CallDepth
Constants ¶
const DefaultMaxCallDepth = 1000
DefaultMaxCallDepth is the default maximum call depth (1000)
Variables ¶
Functions ¶
func ApplyFunction ¶
func ApplyFunction(ctx context.Context, fn object.Object, args []object.Object, keywords map[string]object.Object, env *object.Environment) object.Object
ApplyFunction calls a function object with arguments and keyword arguments. This is exported for use by other packages that need to call script functions directly.
func ContextWithCallDepth ¶
ContextWithCallDepth creates a context with a call depth tracker
func ContextWithSourceFile ¶
ContextWithSourceFile creates a context with source file info for error reporting
func EvalWithContext ¶
EvalWithContext executes with context for timeout/cancellation
func GetEnvFromContext ¶
func GetEnvFromContext(ctx context.Context) *object.Environment
GetEnvFromContext retrieves environment from context for external functions
func GetImportBuiltin ¶
func GetSourceFileFromContext ¶
GetSourceFileFromContext retrieves source file name from context
func SetCallDepthInContext ¶
SetCallDepthInContext stores call depth tracker in context
func SetEnvInContext ¶
SetEnvInContext stores environment in context for builtin functions
Types ¶
type CallDepth ¶
type CallDepth struct {
// contains filtered or unexported fields
}
CallDepth tracks function call depth to prevent stack overflow
func GetCallDepthFromContext ¶
GetCallDepthFromContext retrieves call depth tracker from context
func NewCallDepth ¶
NewCallDepth creates a new CallDepth tracker with the specified max depth