1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Private pipeline types for the layered parser.
use Range;
// =================================================================
// Private types for the layered tokenizer/classifier/assembler pipeline
// =================================================================
/// An H2-like heading inside a
/// Bookmark Content/Source body context can play one of two
/// roles:
///
/// - `SectionBoundary` — the heading opens a new top-level
/// section (`## Content`, `## Source`) or carries metadata
/// (`## Tags`); the body-fragmentation algorithm demarcates
/// a fragment at this position.
/// - `InternalBody` — the heading appears inside an existing
/// Content/Source body (e.g., frozen E10.1's `## Tags in
/// body`) and is treated as opaque body content; the
/// body-fragmentation algorithm absorbs it into the open
/// body fragment.
///
/// The classifier tags each
/// heading with a `HeadingRole`; the assembler is the only
/// component that consumes the role. The classifier never
/// selects canonical metadata (e.g., "which `## Tags` is the
/// canonical one"); the assembler does.
pub
/// H2 section descriptor used by the bookmark assembler when
/// computing section extents. The text is the heading text
/// (trimmed) and the range is the full section extent
/// (heading + body up to the next heading or end-of-source).
pub
/// Index into the tokenizer's `Vec<Line>` for a given physical line.
pub type LineId = usize;
/// One token per physical line, emitted by the per-kind classifier.
pub
/// Narrow private parse failure. Translated to `NbError` once at
/// the public boundary in [`parse`].
pub
/// Walk past leading blank-line intervals (whitespace-only lines
/// or bare line terminators) starting at `pos`, without pushing
/// any separator ranges. Returns the offset of the first
/// non-blank content (or `source.len()` if the source ends with
/// blank lines).
///
/// Used by the Bookmark assembler's tail handling: when the last
/// processed heading is Tags, the trailing content is split
/// into leading blank-line intervals (separators) and the
/// remaining body. This helper returns the boundary without
/// pushing separators (the caller does that).
/// Half-open byte range alias used by the layered pipeline.
pub type ByteRange = ;