Skip to main content

Module ast

Module ast 

Source
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; info is the text after the opening fence.
Heading
A markdown heading (#..######); level is 1–6.
ListItem
A single list item (-/* or numbered).
Paragraph
A markdown paragraph.
Row
One row of a table: cells and cell_spans are parallel, same-length.
SegmentOffset
Maps a block-text offset to its source offset (both UTF-16).
Table
A markdown table: a header Row plus zero or more data rows.
ThematicBreak
A thematic break (---/***/___).

Enums§

Block
A markdown block node — the closed union the structurer matches over.
TableOrFence
The block kinds that may appear as a Doc orphan attachment (Table | Fence).