sipha-error
Error handling and diagnostics for sipha parsers.
Overview
sipha-error provides comprehensive error handling and diagnostic capabilities for sipha parsers:
- ParseError: Enum with all parse error variants
- Expected: Type for describing expected tokens
- ErrorContext: Context tracking for error reporting
- Diagnostic: Rich diagnostic types with miette integration (optional)
Features
default: Includesdiagnosticsfeaturediagnostics: Enables rich error diagnostics with miette integrationcolor: Adds color support for error output (requiresdiagnostics)
Quick Start
Add sipha-error to your Cargo.toml:
[]
= "0.1.1"
With diagnostics:
[]
= { = "0.1.1", = ["diagnostics", "color"] }
Example
use ;
use ;
let error = Expected ;
License
This project is licensed under the MIT License - see the LICENSE file for details.