interpreter

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interpreter

type Interpreter struct {
	// the cosh shell
	Shell *shell.Shell

	// the yaegi interpreter
	Interp *interp.Interpreter
}

Interpreter represents one running shell context

func NewInterpreter

func NewInterpreter(options interp.Options) *Interpreter

NewInterpreter returns a new Interpreter initialized with the given options.

func (*Interpreter) Eval

func (in *Interpreter) Eval(code string) error

Eval evaluates (interprets) the given code.

func (*Interpreter) Prompt

func (in *Interpreter) Prompt() string

Prompt returns the appropriate REPL prompt to show the user.

func (*Interpreter) RunCode

func (in *Interpreter) RunCode() error

RunCode runs the accumulated set of code lines and clears the stack.

Jump to

Keyboard shortcuts

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