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 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.
Functions§
- build
- is_
cite_ command - Whether
nameis a citation command (\citeand the natbib/biblatex family, plus\nocite). Capitalized biblatex variants (\Cite,\Textcite, …) and thecite-prefixed natbib set are covered by the prefix check; an explicit short list catches the rest. Keys are comma-separated for all of them. - is_
glossary_ ref_ command - Whether
nameis a glossary/acronym reference command whose first{…}group is an entry key (\gls,\acrshort,\glsxtrfull, …). Shared with the completion classifier (crate::completion), likeref_commandandis_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
nameis 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 ofproject::include::include_kind. Shared with the completion classifier (crate::completion) so the ref-family name set has a single source of truth.