Skip to main content

Module builder

Module builder 

Source
Expand description

Build the per-file label/reference model from the CST.

A single whole-tree walk (mirror of project::collect_include_edges) collects \label{…} definitions, literal label options from curated environments, and the reference-command family, then a flat resolve pass matches refs to defs by name. Labels live in one document-global namespace, so there is no scope walk—resolution is a flat name match, not a scope-chain resolution.

Enums§

CiteCommand
The behavior of a curated citation command.

Functions§

build
build_with_declarations
Build the semantic model while honoring project-declared ref/cite aliases.
cite_command
The recognized citation command for a control-word name, or None.
is_glossary_ref_command
Whether name is a glossary/acronym reference command whose first {…} group is an entry key (\gls, \acrshort, \glsxtrfull, …). Shared with the completion classifier (crate::completion), like ref_command and cite_command, so the name set has a single source of truth. Unlike citations, every command here takes exactly one key per group (no comma list).
key_argument_command
Whether name is a command whose arguments hold opaque keys, identifiers, or text rather than typeset math — the \label/\ref/\cite/\gls/color families plus \tag (amsmath, text content) and \hyperref (key plus link text). The union of the family predicates above, kept here so the name sets stay single-sourced; shared with the linter’s key-argument gate (crate::linter::rules::in_key_argument), which uses it to keep identifier keys like \label{eq:thing_max} out of the math-shape rules’ scope.
ref_command
The recognized reference command for a control-word name, or None. A small explicit table — the analog of project::include::include_kind. Shared with the completion classifier (crate::completion) so the ref-family name set has a single source of truth.