repl

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplLoop

func ReplLoop(context ReplContext, shouldRecover bool)

Types

type ChannelReplContext

type ChannelReplContext struct {
	Input  chan string
	Output chan string
	// contains filtered or unexported fields
}

func NewChannelReplContext

func NewChannelReplContext(isDebug, canEval bool) *ChannelReplContext

func (*ChannelReplContext) Context

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

func (ChannelReplContext) OnEnter

func (ChannelReplContext) OnEnter()

func (ChannelReplContext) OnExit

func (ChannelReplContext) OnExit()

func (*ChannelReplContext) ReadCode

func (c *ChannelReplContext) ReadCode(newCode bool, indent string) (string, bool)

func (*ChannelReplContext) WriteResult

func (c *ChannelReplContext) WriteResult(result string)

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) ReadCode

func (c *ConsoleReplContext) ReadCode(newCode bool, initCode string) (string, bool)

func (ConsoleReplContext) WriteResult

func (c ConsoleReplContext) WriteResult(result string)

type ReplContext

type ReplContext interface {
	Context() *runtime.Context
	ReadCode(bool, string) (string, bool)
	WriteResult(string)
	OnEnter()
	OnExit()
}

Jump to

Keyboard shortcuts

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