Skip to main content

parse_document

Function parse_document 

Source
pub fn parse_document(source: &str) -> ParsedDocument
Expand description

Parses source as a .pactole document and collects syntax diagnostics.

This function never fails: malformed input yields a ParsedDocument whose ParsedDocument::diagnostics describe the ERROR/MISSING nodes found in the resulting concrete syntax tree.

ยงPanics

Panics if the tree-sitter parser fails to load the Pactole grammar or fails to produce a tree for a string input. Either case indicates a build-time or library invariant violation rather than a user-facing parse error.