evaluator

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NONE  = &object.None{Value: "None"}
	TRUE  = &object.Boolean{Value: true}
	FALSE = &object.Boolean{Value: false}

	MAX_CALL_DEPTH              = 1000
	CurrentContext *CallContext = nil
)
View Source
var LineReader *liner.State

Functions

func CleanupCallStack added in v0.1.6

func CleanupCallStack(fn *object.Function)

CleanupCallStack removes entries from call stack for specific function

func CleanupGlobalState added in v0.1.6

func CleanupGlobalState()

CleanupGlobalState clears all global state maps to prevent memory leaks

func CleanupRecursionDepth added in v0.1.6

func CleanupRecursionDepth(node *ast.BlockStatement)

CleanupRecursionDepth removes recursion tracking for specific AST node

func Eval

func Eval(node ast.Node, env *object.Environment, ctx *CallContext) object.Object

Main evaluation function

func EvalWithDebug added in v0.1.6

func EvalWithDebug(node ast.Node, env *object.Environment, ctx *CallContext, debugConfig *debug.Config) object.Object

EvalWithDebug evaluates an AST node with debug output

func LoadModules added in v0.1.7

func LoadModules(env *object.Environment)

func LoadMuninStdlib

func LoadMuninStdlib(env *object.Environment) error

func SetStdlibEnv added in v0.1.7

func SetStdlibEnv(env *object.Environment)

SetStdlibEnv sets the global reference to the standard library environment

Types

type CallContext added in v0.1.6

type CallContext struct {
	FunctionName string
	Node         ast.Node
	Parent       *CallContext

	IsDirectExecution bool // True when file is run directly, false when imported
	// contains filtered or unexported fields
}

CallContext tracks function call state for better error reporting

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL