repl

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
View Source
const Oops = `` /* 554-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type REPL

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

func NewREPL

func NewREPL(v *vm.VM, in io.Reader, out io.Writer) *REPL

func (*REPL) AddPostInit

func (r *REPL) AddPostInit(fn func(*vm.VM))

func (*REPL) DisassembleFile

func (r *REPL) DisassembleFile(path string)

func (*REPL) ExecFile

func (r *REPL) ExecFile(path string) error

ExecFile reads, compiles and runs a script in a fresh VM (with the registered post-init hooks applied) and returns the first error instead of exiting, so long-lived callers such as -watch can keep going.

func (*REPL) ExecFileVM

func (r *REPL) ExecFileVM(path string) (*vm.VM, error)

ExecFileVM is ExecFile but also returns the VM the script ran in (nil if the script never started), so callers can inspect its state afterwards.

func (*REPL) RunFile

func (r *REPL) RunFile(path string)

RunFile runs a script and exits the process with status 1 if it fails to read, compile or run. Use ExecFile to get the error instead.

func (*REPL) Start

func (r *REPL) Start()

func (*REPL) WatchFile

func (r *REPL) WatchFile(filePath string) error

Jump to

Keyboard shortcuts

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