ghost

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Env = object.NewEnvironment()

	// Version returns the current version of Ghost.
	Version = version.String()

	// NULL represents a null value.
	NULL = value.NULL

	// TRUE represents a true value.
	TRUE = value.TRUE

	// FALSE represents a false value.
	FALSE = value.FALSE
)

Global values

Functions

func Call added in v0.6.0

func Call(source string, env *object.Environment) (_env *object.Environment, obj object.Object, errors []string)

Call evaluates the specified code directly with the passed environment.

func Evaluate

func Evaluate() (env *object.Environment, obj object.Object, errors []string)

Evaluate runs the registered script through the Ghost evaluator.

func NewError

func NewError(line int, message string, args ...interface{}) *object.Error

NewError returns a new error object used during runtime.

func NewScript

func NewScript(source string)

NewScript registers a new Ghost script to be evaluated.

func RegisterFunction

func RegisterFunction(name string, function object.BuiltinFunction)

RegisterFunction registers a new native function with Ghost.

Types

type Script

type Script struct {
	// contains filtered or unexported fields
}

Script stores a new Ghost script source.

Jump to

Keyboard shortcuts

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