mruby

package
v0.0.0-...-67d9101 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2017 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Filename string
	Interp   *command.Interpreter
	Exec     executor.Executor
	Globals  *types.Global
}

Config is the parameters for the mruby engine

type MRuby

type MRuby struct {
	*Config
	// contains filtered or unexported fields
}

MRuby is an Evaluator that can handle mruby interpreters.

func NewMRuby

func NewMRuby(config *Config) (*MRuby, error)

NewMRuby instantiates a *MRuby.

func (*MRuby) Close

func (m *MRuby) Close() error

Close the interpreter.

func (*MRuby) Result

func (m *MRuby) Result() types.BuildResult

Result returns the last BuildResult for this evaluator.

func (*MRuby) RunCode

func (m *MRuby) RunCode(line string, stackKeep int, make bool) (int, error)

RunCode runs the value intended to be a *gm.MrbValue in the mruby instance which is a proc to some code to run, and the previous stack reference (or 0 for none). The result is both a BuildResult and an integer that the refers to a stack in the mruby interpreter.

This is typically used for instantiating code in a REPL; so that it can be appropriately evaluated and on any evaluation error, return its position so the evaluation can continue.

Given this function is intended to run multiple times, it does not execute the after hooks if they are set.

func (*MRuby) RunScript

func (m *MRuby) RunScript(script string) error

RunScript runs the string provided. Returns a BuildResult

Jump to

Keyboard shortcuts

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