repl

package
v0.0.0-...-615059b Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebuggerHandler

func DebuggerHandler(vm *jyg.Jyg)

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

func Run

func Run(vm *jyg.Jyg) error

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

func RunWithOptions

func RunWithOptions(vm *jyg.Jyg, options Options) error

RunWithOptions runs a REPL with the given options.

func RunWithPrelude

func RunWithPrelude(vm *jyg.Jyg, prelude string) error

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

func RunWithPrompt

func RunWithPrompt(vm *jyg.Jyg, prompt string) error

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

func RunWithPromptAndPrelude

func RunWithPromptAndPrelude(vm *jyg.Jyg, prompt, prelude string) error

RunWithPromptAndPrelude runs a REPL with the given prompt and prelude.

Types

type Options

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.

Jump to

Keyboard shortcuts

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