eval

package
v0.0.0-...-a3a69d7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package eval facilitates compile-time evaluation of expressions. This covers arithmetic and comparison operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(instr *parser.List, resolve referenceFunc, scope parser.Scope) error

Evaluate evaluates the expressions in the given instruction.

Types

type Error

type Error struct {
	Pos parser.Position
	Msg string
}

Error defines a evaluation error with source context.

func NewError

func NewError(pos parser.Position, f string, argv ...interface{}) *Error

NewError creates a new, formatted error message with the given source context.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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