Skip to main content

Module math

Module math 

Source
Expand description

Math AST node wrappers.

Structs§

DisplayMath
MathContent
The MATH_CONTENT subtree root: the parsed TeX content between (but excluding) the math delimiters. Spliced into the host document tree, so its tokens carry host-aligned ranges.
MathDelimited
A \left<d> ... \right<d> paired-delimiter run.
MathDiagnostic
A structural problem found in a realized MATH_CONTENT subtree. The range is host-aligned (the subtree is spliced into the host document tree), so a consumer turns it straight into a diagnostic span with no remapping.
MathEnvironment
A \begin{env} ... \end{env} environment.
MathGroup
A { ... } brace group.

Enums§

MathDiagnosticKind
The kind of a MathDiagnostic. A neutral structural identity; downstream consumers (the linter, LSP) map it to their own code and message. The parser crate deliberately does not own linter code strings.

Functions§

math_content_text
Reconstruct the raw math content of a math node from its MATH_CONTENT subtree, keeping only the math tokens.
math_diagnostics
Walk a realized MATH_CONTENT subtree and report structural problems from its shape. This is the single source of truth for math diagnostics, shared by the math-syntax linter rule, the formatter (malformed math is left verbatim rather than reflowed), and the LSP. Ranges are host-aligned.