Documentation
¶
Overview ¶
Package fmtraw grants in-repo tooling access to the formatting metadata stored in lisp values' unexported meta field (see internal/fmtmeta for the metadata itself and the history of why the field is unexported — issue #382).
lisp.LVal deliberately has no exported metadata accessors: the metadata only exists on format-preserving parse trees, which are produced and owned by parser/rdparser, read by the formatter, and never sealed, evaluated, or shared. This package is the sanctioned path between those tools and the field: it lives under internal/, so the Go compiler limits it to this module — an embedder importing elps cannot reach the field at all.
The accessors are injected by package lisp's init through the untyped slots in the hook subpackage (see hook's doc comment for the cycle it breaks). Writers MUST own the tree they stamp: the parser writes only nodes it produced during the current parse, before anything else can see them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Meta func(v *lisp.LVal) *fmtmeta.Meta
Meta returns v's formatting metadata, or nil when v carries none (always nil outside format-preserving parses). The returned struct is v's own — the format-preserving parser mutates it through this pointer while it still owns the tree; everyone else treats it as read-only. Injected by package lisp's init; importing this package imports lisp, so the accessors are always non-nil by the time user code runs.
var SetMeta func(v *lisp.LVal, m *fmtmeta.Meta)
SetMeta attaches m as v's formatting metadata, replacing any existing metadata. Only the format-preserving parser should call it, on nodes it produced during the current parse.
Functions ¶
Types ¶
This section is empty.