repl

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInputCode added in v1.0.12

func ParseInputCode(code string, shouldRecover bool) (compiled runtime.IEval, err error)

func ReplLoop

func ReplLoop(context ReplContext, shouldRecover bool)

Types

type ConsoleReplContext

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

func NewConsoleReplContext

func NewConsoleReplContext(isDebug, canEval bool) *ConsoleReplContext

func (*ConsoleReplContext) Context

func (c *ConsoleReplContext) Context() *runtime.Context

func (ConsoleReplContext) OnEnter

func (c ConsoleReplContext) OnEnter()

func (ConsoleReplContext) OnExit

func (c ConsoleReplContext) OnExit()

func (*ConsoleReplContext) ReadAction added in v1.0.12

func (c *ConsoleReplContext) ReadAction(shouldRecover bool) ReplAction

func (ConsoleReplContext) WriteException added in v1.0.19

func (c ConsoleReplContext) WriteException(e runtime.Exception)

func (ConsoleReplContext) WriteResult

func (c ConsoleReplContext) WriteResult(result interface{})

type ReplAction added in v1.0.12

type ReplAction interface {
	Handle(context ReplContext, shouldRecover bool) (continueRunning bool)
}

type ReplContext

type ReplContext interface {
	Context() *runtime.Context
	ReadAction(bool) ReplAction
	WriteResult(interface{})
	WriteException(runtime.Exception)
	OnEnter()
	OnExit()
}

type ReplContextWithShouldWriteResult added in v1.0.12

type ReplContextWithShouldWriteResult interface {
	ShouldWriteResult(codeAst ast.Node) bool
}

type ReplExit added in v1.0.12

type ReplExit struct{}

func (ReplExit) Handle added in v1.0.12

func (ReplExit) Handle(context ReplContext, shouldRecover bool) bool

type ReplHintCode added in v1.0.12

type ReplHintCode string

func (ReplHintCode) Handle added in v1.0.12

func (rrc ReplHintCode) Handle(context ReplContext, shouldRecover bool) bool

type ReplNoop added in v1.0.12

type ReplNoop struct{}

func (ReplNoop) Handle added in v1.0.12

func (ReplNoop) Handle(context ReplContext, shouldRecover bool) bool

type ReplRunCode added in v1.0.12

type ReplRunCode struct {
	Err      error
	Compiled runtime.IEval
}

func (ReplRunCode) Handle added in v1.0.12

func (rrc ReplRunCode) Handle(context ReplContext, shouldRecover bool) (shouldContinue bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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