Expand description
AST node types produced by the scanner/structurer — port of ast.ts /
Ast.java. Pure data; the sealed Block/TableOrFence interfaces become
Rust enums (exhaustive match replaces instanceof). Immutability is by
construction (owned fields, no mutation) — Java’s List.copyOf defensive
copies have no Rust analog.
Structs§
- Blockquote
- A markdown blockquote (
>). - Doc
- A parsed source file: its matched examples plus unattached table/fence blocks.
- Example
- One matched example: the heading scope above it (outer→inner) plus its body blocks (first is the candidate primary block, then any trailing attachments).
- Fence
- A fenced code block;
infois the text after the opening fence. - Heading
- A markdown heading (
#..######);levelis 1–6. - List
Item - A single list item (
-/*or numbered). - Paragraph
- A markdown paragraph.
- Row
- One row of a table:
cellsandcell_spansare parallel, same-length. - Segment
Offset - Maps a block-text offset to its source offset (both UTF-16).
- Table
- A markdown table: a header
Rowplus zero or more data rows. - Thematic
Break - A thematic break (
---/***/___).
Enums§
- Block
- A markdown block node — the closed union the structurer matches over.
- Table
OrFence - The block kinds that may appear as a
Docorphan attachment (Table | Fence).