Skip to main content

Module parser

Module parser 

Source
Expand description

Nom-based parser for SysML v2 textual notation.

Organized into modules:

  • [lex]: whitespace, comments, names, qualified names, skip helpers
  • [diagnostics]: nom error mapping, diagnostic classification, deduplication
  • [recovery]: recovery error nodes for structured body parsing
  • [collect_errors]: aggregate diagnostics from AST recovery nodes
  • [parse]: parse_root and parse_with_diagnostics entry points
  • [attribute]: attribute definition and usage
  • [import]: import and relationship body
  • [part]: part definition and part usage
  • [package]: package and root namespace

Modules§

diagnostic_catalog
Stable parser diagnostic code registry for Spec42 and LSP consumers.

Structs§

ParseResult
Result of parsing with error recovery: a (possibly partial) AST and zero or more diagnostics.

Functions§

parse_root
Parse full input; must consume entire input. Strips UTF-8 BOM if present.
parse_with_diagnostics
Parse input with error recovery: collects multiple diagnostics and returns a partial AST when errors occur. Use this for language servers so the user sees all parse errors and features (e.g. hover) can use the partial AST.