Skip to main content

parse_to_doc

Function parse_to_doc 

Source
pub fn parse_to_doc(source: &str) -> Result<Option<ParsedDoc>, ParseError>
Expand description

Parse source and return a ParsedDoc: source bytes, line index, and syntax root.

Use this when you need offset-to-line/column, ParsedDoc::node_at_offset, ParsedDoc::token_at_offset, or formatted diagnostics. Returns None if the parse produced no or invalid tree events.