Expand description
Single-file semantic analysis.
builder::build collects definitions and uses in a single CST walk, then
resolves them within the file. Incremental caching belongs to the root crate.
Labels have document-wide rather than lexical scope. This model remains flat and leaves cross-file resolution to the project layer.
Re-exports§
pub use define::DefSite;pub use define::DefSiteKind;pub use define::scan_definition_sites;pub use define::scan_definitions;pub use doc::DocAssociation;pub use doc::DocKind;pub use doc::doc_associations;pub use label::CitationRef;pub use label::ColorDef;pub use label::ColorDefKind;pub use label::GlossaryDef;pub use label::GlossaryDefKind;pub use label::LabelDef;pub use label::LabelId;pub use label::LabelRef;pub use label::RefCommand;pub use label::RefId;pub use math::DelimiterRole;pub use math::MathAtom;pub use math::MathAtomInfo;pub use math::MathAtoms;pub use math::MathClass;pub use math::NAMED_MATH_OPERATORS;pub use math::math_atoms;pub use math::math_char_info;pub use math::math_command_info;pub use mode::Mode;pub use mode::ModeIndex;pub use mode::argument_domain;pub use outline::LabelContext;pub use outline::OutlineItem;pub use outline::OutlineSymbol;pub use outline::label_context;pub use outline::outline;pub use pkgmeta::NeedsFormatDecl;pub use pkgmeta::OptionDecl;pub use pkgmeta::ProvidesDecl;pub use pkgmeta::ProvidesKind;pub use signature::ArgKind;pub use signature::ArgSpec;pub use signature::ArgumentDomain;pub use signature::CommandSig;pub use signature::ContentKind;pub use signature::EnvironmentSig;pub use signature::SignatureDb;pub use signature::Signatures;pub use signature::match_arg_slot;pub use signature::match_arg_slot_index;pub use signature::match_verbatim_arg_slot;
Modules§
- builder
- Build the per-file label/reference model from the CST.
- define
- Scan a document for user definitions —
\newcommand/\newenvironmentand the xparse\NewDocument…family — and extract their argument signatures into a per-documentSignatureDb. The scanner reads declared argument shapes, but neither interprets replacement text nor executes definitions. - doc
- Associate
.dtxdocumentation prose with the macro/environment it documents. - expl3
- The expl3 call-site model: argspec arity for expl3 function names, and the statement segmentation built on it.
- label
- Label definitions and reference uses — the data of the per-file
label/reference model:
Vec-stored records addressed by newtype ids. - math
- Static math-atom classification over the lossless CST.
- mode
- Effective text/math mode over a lossless syntax tree.
- outline
- Build a document-symbol outline from the CST: the sectioning hierarchy
(
\part…\subparagraph), with float/theorem environments,\labels, and a.dtx’s documented macros/environments (viadoc_associations) as leaves. LSP-agnostic by design (byte ranges, nolsp_types) so it is unit-testable without the language server; thelspmodule converts theOutlineItemtree intolsp_types::DocumentSymbol. - pkgmeta
- Static recognition of the package/class authoring commands — the metadata a
.sty/.clsdeclares about itself. Definitions are inspected, not executed. - signature
- The built-in signature database: command/environment argument shapes plus the semantic metadata a formatter/linter needs (sectioning level, verbatim-ness, math-ness). Meaning is assigned here rather than in the parser.
- tikz
- The TikZ/pgf statement unit model: which gaps inside a picture-body
STATEMENTare unit-internal and must never become width-break opportunities. - xparse
- Parser for the xparse argument specification mini-language — the string in
the second group of
\NewDocumentCommand{\foo}{<spec>}{…}(and the environment variants). It describes argument shapes; processing behavior is ignored.
Structs§
- Semantic
Model - A file’s label definitions and reference uses.