Skip to main content

parse_file

Function parse_file 

Source
pub fn parse_file(
    path: impl AsRef<Path>,
    component_defs: &ComponentDefs,
) -> Result<ParseResult, Vec<ParseError>>
Expand description

Parse a single spec file into a ParseResult.

Implements the full parsing pipeline:

  1. Preprocess (UTF-8 decode, BOM strip, CRLF normalize).
  2. Front matter extraction and deserialization.
  3. Markdown fence extraction (supersigil-xml).
  4. XML parsing and component extraction.
  5. Lint-time validation.

Stage 1 fatal errors prevent later stages. XML parse errors in one fence do not prevent other fences from being parsed.

ยงErrors

Returns Vec<ParseError> containing all detected errors across stages.