Expand description
Error and diagnostic system for the Orrery parser.
This module provides an error handling system with:
- Error codes for documentation and searchability
- Multiple labeled spans for rich error context
- Severity levels
- Diagnostic collector for accumulating multiple errors
§Overview
The error system is built around the Diagnostic type, which represents
a single error or warning message with optional error code, multiple source
locations, and help text. Multiple diagnostics are wrapped in ParseError
for returning from the parsing lifecycle.
§Example
let span = Span::new(100..120);
let original_span = Span::new(50..70);
let diag = Diagnostic::error("cannot override built-in type `Component`")
.with_code(ErrorCode::E301)
.with_label(span, "type override not supported")
.with_help("built-in types cannot be redefined");Structs§
- Diagnostic
- A rich diagnostic message with source location information.
- Label
- A labeled span in source code.
- Parse
Error - Error type for the parsing lifecycle.
- Source
Error - Error returned by
SourceProvideroperations.