Skip to main content

Module core

Module core 

Source
Expand description

The parser entry point and its output type.

parse runs the pipeline: lex → [grammar::parse] (the recursive descent, which emits events + errors) → [build_tree] (the green tree). Syntax errors ride a side channel and never abort the parse.

Structs§

Parse
A parsed document: the green tree plus any syntax errors gathered alongside it. Errors never abort the parse (see AGENTS.md, Core decision #5).
SyntaxError
A syntax error, carried on a side channel keyed by byte range.

Functions§

parse
Parse LaTeX source into a lossless CST.
parse_with_flavor
Parse LaTeX source into a lossless CST under an explicit LexConfig.
reconstruct
Parse input and render the CST back to source. By the losslessness invariant this always equals input.