Skip to main content

parse_structured

Function parse_structured 

Source
pub fn parse_structured(source: &str) -> SyntaxNode
Expand description

Parse source to a structured lossless CST.

Recognizes the 14 single-line directive shapes (PR 2.1a) plus TRANSACTION (PR 2.1b) plus the 4 edge directives OPTION / INCLUDE / PLUGIN / CUSTOM (PR 2.3), and wraps each in its specific node kind. Trivia attaches per the Directive- Terminator Rule.

Unrecognized / malformed top-level lines are wrapped in an ERROR_NODE (PR 2.4) — same trivia attachment policy as recognized directives and the same rule-5 unterminated-at-EOF behavior. Round-trip byte-identical for every UTF-8 input.