Expand description
The DCF parser: one forward pass over physical lines.
Unlike the R grammar, this needs no event pipeline. Events exist there
because the Pratt parser must retroactively wrap tokens it has already
passed; DCF never backtracks and nests no deeper than
ROOT > RECORD > FIELD > VALUE_LINE, so a direct GreenNodeBuilder walk
is the whole parser.
Losslessness is structural: the scanner carries one byte cursor and
every emitted token is a slice text[a..b] with a the previous token’s
end. Note the deliberate absence of str::lines — it eats the \r of a
CRLF pair and erases the difference between a final line with and without a
trailing newline.
Re-exports§
pub use crate::parser::ParseDiagnostic;
Structs§
Functions§
- parse
- Parse DCF text into a lossless CST plus any diagnostics.
- reconstruct
- Round-trip
textthrough the parser. Always equal totext.