repl

package
v6.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonPrefix

func CommonPrefix(vals []string) string

func Run

func Run(c *app.Calc)

Types

type Cmd

type Cmd func(*Repl, []scan.Token) error

type Repl

type Repl struct {
	MaxUndo  int
	Calc     *app.Calc
	Out      io.Writer
	EndQuote string
	// contains filtered or unexported fields
}

func New

func New(calc *app.Calc) *Repl

func (*Repl) Close

func (r *Repl) Close()

func (*Repl) Error

func (r *Repl) Error() error

func (*Repl) Eval

func (r *Repl) Eval(line string) error

func (*Repl) Init

func (r *Repl) Init()

func (*Repl) Notice

func (r *Repl) Notice() string

func (*Repl) ReadLine

func (r *Repl) ReadLine() (string, error)

func (*Repl) WordCompleter

func (r *Repl) WordCompleter(line string, pos int) (string, []string, string)

type ReplTester

type ReplTester struct {
	Calc *app.Calc
	Repl *Repl
	// contains filtered or unexported fields
}

func NewReplTester

func NewReplTester(t *testing.T) *ReplTester

func (*ReplTester) AssertError

func (r *ReplTester) AssertError(msg string)

func (*ReplTester) AssertNotice

func (r *ReplTester) AssertNotice(notice string)

func (*ReplTester) AssertStack

func (r *ReplTester) AssertStack(vals ...any)

func (*ReplTester) Eval

func (r *ReplTester) Eval(line string)

Jump to

Keyboard shortcuts

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