eval

package
v0.0.0-...-6ec744d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NULL - the single null object
	NULL = &object.Null{}
	// TRUE - An invariant
	TRUE = &object.Boolean{Value: true}
	// FALSE - An invariant
	FALSE = &object.Boolean{Value: false}
)

Functions

func EvaluateComp

func EvaluateComp(
	left, right object.Object,
	op string,
	con lexer.Context,
) object.Object

EvaluateComp compares two values to see if they are equal

func EvaluateSides

func EvaluateSides(left, right object.Object, op string, con lexer.Context) object.Object

EvaluateSides performs an arithmetic operation on two objects

Types

type Evaluator

type Evaluator struct {
	Ctxt lexer.Context
	// contains filtered or unexported fields
}

Evaluator epresents the program that walks the tree

func New

func New() *Evaluator

New - returns a new evaluator

func (*Evaluator) Evaluate

func (e *Evaluator) Evaluate(node ast.Node, env *object.Environment) object.Object

Evaluate runs the evaluator, walking the tree and executing code

Jump to

Keyboard shortcuts

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