monkey-lang: github.com/prologic/monkey-lang/repl Index | Files

package repl

import "github.com/prologic/monkey-lang/repl"

Index

Package Files

repl.go

Constants

const MonkeyFace = "" /* 275 byte string literal not displayed */

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

const PROMPT = ">> "

PROMPT is the REPL prompt displayed for each input

type Options Uses

type Options struct {
    Debug       bool
    Engine      string
    Interactive bool
}

type REPL Uses

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

func New Uses

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

func (*REPL) Eval Uses

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 Uses

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 Uses

func (r *REPL) Run()

func (*REPL) StartEvalLoop Uses

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 Uses

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

StartExecLoop starts the REPL in a continious exec loop

Package repl imports 12 packages (graph) and is imported by 1 packages. Updated 2019-04-03. Refresh now. Tools for package owners.