pub struct BlockParser {
pub options: Options,
pub refmap: RefMap,
pub tree: Tree,
pub table_armed: bool,
/* private fields */
}Expand description
The block-phase parser: the open spine, the current line, and the tree being built.
Fields§
§options: Options§refmap: RefMap§tree: Tree§table_armed: boolThe GFM table probe gate. True by default: the batch driver probes
every candidate line, as it always has. The engine driver sets it
per line from the #LB token’s tblArm bit (a provable superset of
“could be a delimiter row”; see engine_block.rs), which is what
lets the GFM alt be a genuine, subtractable extension seam without
moving any table decision out of this file.
Implementations§
Source§impl BlockParser
impl BlockParser
pub fn new(options: Options) -> Self
Sourcepub fn incorporate_line(&mut self, ln: &str)
pub fn incorporate_line(&mut self, ln: &str)
Incorporate one line into the tree: the three steps of Appendix A.
Sourcepub fn parse(self, input: &str) -> (Tree, RefMap)
pub fn parse(self, input: &str) -> (Tree, RefMap)
Feed every line of input and finish. An empty document still
incorporates one empty line, exactly as the historical split-based
loop did: line count and sourcepos depend on it. Line cutting and
section 2.3 NUL replacement both live in segment_next_line.
Sourcepub fn finish(self) -> (Tree, RefMap)
pub fn finish(self) -> (Tree, RefMap)
Close every still-open block, stamp the parse-time gfm flag, and
run the task-list post-pass. line_number is the count of
incorporated lines, so an incremental driver (one that feeds
incorporate_line itself instead of calling parse) finishes with
exactly the same finalization the batch loop gets.