evaluator

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package evaluator contains the core of our interpreter, which walks the AST produced by the parser and evaluates the user-submitted program.

Index

Constants

This section is empty.

Variables

View Source
var (
	NULL    = &object.Null{}
	TRUE    = &object.Boolean{Value: true}
	FALSE   = &object.Boolean{Value: false}
	PRAGMAS = make(map[string]int)
)

pre-defined object including Null, True and False

Functions

func Eval

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

Eval is our core function for evaluating nodes.

func EvalContext

func EvalContext(ctx context.Context, node ast.Node, env *object.Environment) object.Object

EvalContext is our core function for evaluating nodes. The context.Context provided can be used to cancel a running script instance.

func RegisterBuiltin

func RegisterBuiltin(name string, fun object.BuiltinFunction)

RegisterBuiltin registers a built-in function. This is used to register our "standard library" functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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