otto: github.com/robertkrimen/otto/repl Index | Files

package repl

import "github.com/robertkrimen/otto/repl"

Package repl implements a REPL (read-eval-print loop) for otto.

Index

Package Files

autocompleter.go repl.go

func DebuggerHandler Uses

func DebuggerHandler(vm *otto.Otto)

DebuggerHandler implements otto's debugger handler signature, providing a simple drop-in debugger implementation.

func Run Uses

func Run(vm *otto.Otto) error

Run creates a REPL with the default prompt and no prelude.

func RunWithOptions Uses

func RunWithOptions(vm *otto.Otto, options Options) error

RunWithOptions runs a REPL with the given options.

func RunWithPrelude Uses

func RunWithPrelude(vm *otto.Otto, prelude string) error

RunWithPrelude runs a REPL with the default prompt and the given prelude.

func RunWithPrompt Uses

func RunWithPrompt(vm *otto.Otto, prompt string) error

RunWithPrompt runs a REPL with the given prompt and no prelude.

func RunWithPromptAndPrelude Uses

func RunWithPromptAndPrelude(vm *otto.Otto, prompt, prelude string) error

RunWithPromptAndPrelude runs a REPL with the given prompt and prelude.

type Options Uses

type Options struct {
    // Prompt controls what's shown at the beginning of the line. If not
    // specified, this defaults to "> "
    Prompt string
    // Prelude is some text that's printed before control is given to the user.
    // By default this is empty. If specified, this will be printed with a
    // newline following it.
    Prelude string
    // Autocomplete controls whether this REPL session has autocompletion
    // enabled. The way autocomplete is implemented can incur a performance
    // penalty, so it's turned off by default.
    Autocomplete bool
}

Options contains parameters for configuring a REPL session.

Package repl imports 7 packages (graph) and is imported by 2 packages. Updated 2017-06-25. Refresh now. Tools for package owners.