eval

package
v0.0.0-...-b9edb71 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(m Exports)

Register additional libraries for the interpreter.

Types

type Exports

type Exports struct {
	Symbols interp.Exports
	Context func(ctx context.Context, g script.Game) context.Context
}

type FS

type FS interface {
	fs.FS
	fs.StatFS
}

type File

type File interface {
	fs.File
	fs.ReadDirFile
}

type VM

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

func NewVM

func NewVM(g script.Game, opts VMOptions) *VM

func (*VM) Close

func (vm *VM) Close() error

func (*VM) Exec

func (vm *VM) Exec(s string) (reflect.Value, error)

func (*VM) ExecFile

func (vm *VM) ExecFile(pkg string) error

func (*VM) GetSymbol

func (vm *VM) GetSymbol(name string, typ reflect.Type) (reflect.Value, bool, error)

func (*VM) OnEvent

func (vm *VM) OnEvent(typ script.EventType)

func (*VM) OnFrame

func (vm *VM) OnFrame()

type VMOptions

type VMOptions struct {
	Log       *slog.Logger
	ScriptLog *slog.Logger
	MapsDir   string
	ModsDir   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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