repl

package
v0.0.0-...-fe623b8 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileScript

func CompileScript(file string, opts ...ReplOption) error

func Default

func Default() func() Liner

func Run

func Run(opts ...ReplOption)

func RunScript

func RunScript(file string, interactive bool, opts ...ReplOption)

Types

type History

type History struct {
	List []string
	// contains filtered or unexported fields
}

func GetHistory

func GetHistory() *History

func (*History) Append

func (h *History) Append(v string)

func (*History) Get

func (h *History) Get() []string

func (*History) Truncate

func (h *History) Truncate()

type KeyWord

type KeyWord struct {
	Word string
	Desc string
}

type Liner

type Liner interface {
	Prompt(prefix string, o PromptOption) (string, error)
	Close() error
}

type LinerProducer

type LinerProducer func() Liner

type PromptOption

type PromptOption struct {
	History  []string
	Keywords []KeyWord
}

type Repl

type Repl struct {
	*glisp.Environment
	// contains filtered or unexported fields
}

func NewRepl

func NewRepl() *Repl

type ReplOption

type ReplOption func(*Repl)

func SetLiner

func SetLiner(l LinerProducer) ReplOption

type Result

type Result struct {
	Ret glisp.Sexp
	Err error
}

type StreamRepl

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

func NewStreamRepl

func NewStreamRepl(env *glisp.Environment) *StreamRepl

func (*StreamRepl) IsRunning

func (sr *StreamRepl) IsRunning() bool

func (*StreamRepl) Out

func (sr *StreamRepl) Out() <-chan *Result

func (*StreamRepl) ReadRune

func (sr *StreamRepl) ReadRune() (r rune, size int, err error)

func (*StreamRepl) Stop

func (sr *StreamRepl) Stop()

func (*StreamRepl) Write

func (sr *StreamRepl) Write(str string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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