Expand description
Recursive-descent RST parser with docutils-0.22.4 fidelity (M2 wave 1: block grammar only — the inline parser arrives in wave 2).
Fidelity contract: output pformat() is byte-identical to
docutils.parsers.rst.Parser parse-layer output for the construct set in
tests/fixtures/doctree_differential.json. Transforms (doctitle
promotion, target propagation, transition hoisting, message filtering)
are explicitly NOT applied here; they arrive as separate components in
later waves. Behavior sources: the committed differential fixture and the
probe notes in docs/superpowers/plans/2026-08-07-m2-wave1-probes.md.
Modules§
- lines
- Line preprocessing: docutils
statemachine.string2lines(tab_width=8, convert_whitespace=True)equivalent, with byte-span mapping back to the original source (docutils loses this; we keep it for node spans).
Structs§
Functions§
- parse_
rst - Parse RST source into a doctree. Total: never panics, never errors —
problems become
system_messagenodes, exactly like docutils.