scripting

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(vm VM, exp Exp) (interface{}, error)

Eval executes exp on vm, yielding some value and possible error

Types

type AnkoVM

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

AnkoVM is an implememntation of the VM interface using Anko scripting engine

func (*AnkoVM) Define

func (a *AnkoVM) Define(name string, method interface{}) error

Define conforms VM.Execute

func (*AnkoVM) Execute

func (a *AnkoVM) Execute(exp Exp) (interface{}, error)

Execute conforms VM.Execute

type Exp

type Exp string

Exp is a scripted expression to be evaluated on a vm

type VM

type VM interface {
	// Define binds a new method to the vm
	Define(name string, method interface{}) error
	// Execute evaluates exp and returns the yielded value
	Execute(exp Exp) (interface{}, error)
}

VM is an interface of a virtual machine evaluates expressions

func NewAnkoVM

func NewAnkoVM() (VM, error)

NewAnkoVM creates an instance of AnkoVM

Jump to

Keyboard shortcuts

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