Expand description
Content pointers: synthesized nodes that show content written elsewhere in the tree, without copying it.
A content pointer (ContentPointer) is the payload of a synthesized
node that shows, where the node is placed, content written elsewhere in
the tree (an xnote’s content in the list of xnotes, a term in its
definition’s lead-in, a theorem’s title) without copying it: the address of
the node the content belongs to, and the node region of that node that
holds it (one of its arguments or slots; NodeRegion). See content
pointers.
A feature that needs one builds a node of an element of its own carrying a
ContentPointer, and that element’s lowering rule calls
lower_content_pointer. The function lowers the pointed region where the
pointer is placed, through Lowerer::lower_region, as content of the
tree that holds it: a numbered list inside it is numbered as the document
numbered it, a labeled equation is an ordinary labeled reference point.
The content is lowered once, where the pointer is placed, provided the
feature lowers that region nowhere else.
The feature that owns the pointer’s element supplies a check
(PointerCheck) that the node a pointer refers to is one whose region
that element may show, because content shown both through a pointer and in
its own place would appear twice. Where the check fails, it reports a
condition of the feature’s own.
Structs§
- Content
Pointer - The payload of a content pointer: the node some content belongs to, and the node region of that node that holds the content, which the pointer shows where it is placed. A feature’s own synthesized element carries it (see the module documentation).
Functions§
- lower_
content_ pointer - Lowers the content that the node
pointerrefers to through itsContentPointerpayload, wherepointeris placed. Every lowering rule of an element whose nodes carry a content pointer calls this function.
Type Aliases§
- Pointer
Check - The check a feature supplies to
lower_content_pointer. It receives theLowerer, the node a pointer refers to and the node region the pointer gives, and returns whether the pointer’s element may show that region of that node. When it returnsfalse, it must already have reported the refusal (a condition of the feature’s own, at the pointer); the pointer then writes nothing.