internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package internal provides the REPL implementation

Index

Constants

View Source
const (
	// ErrFileNotFound is raised when a file is not found
	ErrFileNotFound = "file not found: %s"

	// UserDomain is the name of the namespace that the REPL starts in
	UserDomain = data.Local("user")
)
View Source
const (
	SP = " "
	NL = "\n"
)

Variables

This section is empty.

Functions

func EvaluateFile

func EvaluateFile(filename string)

EvaluateFile reads the specific source file and evaluates it

func EvaluateStdIn

func EvaluateStdIn()

EvaluateStdIn reads from StdIn and evaluates it

func PrettyPrintAt added in v0.3.0

func PrettyPrintAt(v ale.Value, offset int) string

PrettyPrintAt pretty formats a Value at the given indentation offset

Types

type REPL

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

REPL manages a Read-Eval-Print Loop

func NewREPL

func NewREPL() *REPL

NewREPL instantiates a new REPL instance

func (*REPL) Do

func (r *REPL) Do(line []rune, pos int) ([][]rune, int)

func (*REPL) GetNS

func (r *REPL) GetNS() env.Namespace

GetNS allows the tests to get at the namespace

func (*REPL) Run

func (r *REPL) Run()

Run will perform the Read-Eval-Print-Loop

Directories

Path Synopsis
Package console provides console formatting utilities
Package console provides console formatting utilities
Package docstring provides documentation access for core library functions
Package docstring provides documentation access for core library functions
Package markdown provides markdown formatting for the REPL
Package markdown provides markdown formatting for the REPL

Jump to

Keyboard shortcuts

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