repl

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Debug       bool
	Interactive bool
}

Options are the REPL parameters.

type REPL

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

REPL is the read-evaluate-print loop.

func New

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

New create a 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) Run

func (r *REPL) Run()

Run execute the read-eval loop.

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

Jump to

Keyboard shortcuts

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