evaluator

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

evaluator package is responsible for evaluating the AST nodes and returning the result of the evaluation.

It uses the object package to create and return the evaluated objects. The evaluator package is the heart of the interpreter, where the actual evaluation of the AST nodes happens.

Index

Constants

This section is empty.

Variables

View Source
var (
	NULL  = &object.Null{}
	TRUE  = &object.Boolean{Value: true}
	FALSE = &object.Boolean{Value: false}
)

Functions

func Eval

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

Eval function is the entry point to the evaluator package. It takes an AST node and an environment object as input and returns the evaluated object. The environment object is used to store and retrieve variables and their values. The Eval function is a recursive function that evaluates the AST nodes and returns the evaluated object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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