Skip to main content

parse_with_errors

Function parse_with_errors 

Source
pub fn parse_with_errors(
    input: &str,
    config: Option<ParserOptions>,
) -> (SyntaxNode, Vec<SyntaxError>)
Expand description

Like parse, but also returns the syntax errors the parser found in embedded sublanguages (currently malformed frontmatter / hashpipe YAML).

The errors carry host-aligned ranges, so consumers (the linter) can turn them straight into diagnostics without re-parsing the region or remapping offsets. For pure Markdown the error list is empty.