ocypode_lang/diagnostics/parser/mod.rs
1use miette::{Diagnostic, NamedSource};
2
3pub mod definitions;
4pub mod params;
5
6/// Syntax error diagnostic.
7#[derive(Debug, Diagnostic, thiserror::Error)]
8#[diagnostic(code("parser::syntax_error"))]
9#[error("Syntax error")]
10pub struct SyntaxError {
11 /// The source code.
12 #[source_code]
13 pub src: NamedSource,
14 /// The message.
15 pub message: String,
16 /// The span of the syntax error.
17 #[label("{message}")]
18 pub span: miette::SourceSpan,
19}