diagnosticsource

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package diagnosticsource supplies evaluated inline text and library-confined file contents to the CLI and REPL diagnostic renderers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SourceReader

func SourceReader(runtime *lisp.Runtime, lerr *lisp.LVal) func(string) ([]byte, error)

SourceReader returns a diagnostic source callback using the active runtime. Inline labels prefer retained text; all file reads go through the library. A missing or refusing library never falls back to the host filesystem.

Types

type Reader

type Reader struct {
	lisp.Reader
	// contains filtered or unexported fields
}

Reader retains up to 4 MiB of inline sources by display label, evicting oldest entries first. Physical sources continue through the underlying reader and are retrieved through the active library. Like the runtime reader it wraps, it is used by one evaluation at a time.

func NewReader

func NewReader(reader lisp.Reader) *Reader

NewReader wraps the runtime's parser to retain load-string/load-bytes text.

func (*Reader) Read

func (r *Reader) Read(name string, input io.Reader) ([]*lisp.LVal, error)

Read records the bytes actually parsed, never treating name as a file path.

func (*Reader) ReadLocation

func (r *Reader) ReadLocation(name, loc string, input io.Reader) ([]*lisp.LVal, error)

ReadLocation preserves physical source locations without caching file contents.

Jump to

Keyboard shortcuts

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