macroexp

package
v1.61.2 Latest Latest
Warning

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

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

Documentation

Overview

Package macroexp grants in-repo tests a construction path for the macro-expansion debug metadata sealed inside package lisp.

lisp.LVal deliberately has no exported way to attach macro-expansion metadata — the #370 corruption was exactly such a write landing on shared parser nodes, so the in-kernel stamp (stampMacroExpansion) is the only production writer and external readers get the read-only (*LVal).MacroExpansion snapshot (issue #382). But the debugger's unit tests inside this module fabricate paused expressions carrying expansion metadata to exercise inspection and DAP translation without driving a whole evaluator to a breakpoint. This package is the sanctioned bypass: it lives under internal/, so the Go compiler limits it to this module — an embedder importing elps cannot reach it, and the compile-time closure of the write channel holds at the module boundary where it matters.

The helper is injected by package lisp's init through the untyped slot in the hook subpackage (see hook's doc comment for the cycle it breaks). Nothing outside _test.go files should call Attach.

Index

Constants

This section is empty.

Variables

View Source
var Attach func(v *lisp.LVal, name string, callSite, defSite *token.Location, args []*lisp.LVal, id int64)

Attach fabricates macro-expansion debug metadata on v, as if v had been stamped during expansion of macro name invoked at callSite with the given unevaluated args. Test-only; see the package comment. Injected by package lisp's init; importing this package imports lisp, so the helper is always non-nil by the time user code runs.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package hook is the untyped injection slot behind internal/macroexp.
Package hook is the untyped injection slot behind internal/macroexp.

Jump to

Keyboard shortcuts

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