repl

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MonkeyFace = `` /* 273-byte string literal not displayed */

MonkeyFace is the REPL's face of shock and horror when you encounter a parser error :D

View Source
const PROMPT = ">> "

PROMPT is the REPL prompt displayed for each input

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Debug       bool
	Engine      string
	Interactive bool
}

type REPL

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

func New

func New(user string, args []string, opts *Options) *REPL

func (*REPL) Eval

func (r *REPL) Eval(f io.Reader) (env *object.Environment)

Eval parses and evalulates the program given by f and returns the resulting environment, any errors are printed to stderr

func (*REPL) Exec

func (r *REPL) Exec(f io.Reader) (state *vm.VMState)

Exec parses, compiles and executes the program given by f and returns the resulting virtual machine, any errors are printed to stderr

func (*REPL) Run

func (r *REPL) Run()

func (*REPL) StartEvalLoop

func (r *REPL) StartEvalLoop(in io.Reader, out io.Writer, env *object.Environment)

StartEvalLoop starts the REPL in a continious eval loop

func (*REPL) StartExecLoop

func (r *REPL) StartExecLoop(in io.Reader, out io.Writer, state *vm.VMState)

StartExecLoop starts the REPL in a continious exec loop

Jump to

Keyboard shortcuts

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