2024-01-16 22:59:34 +00:00
|
|
|
use crate::diagnostics::span::Span;
|
|
|
|
|
|
|
|
pub mod span;
|
|
|
|
pub mod emitters;
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
pub struct Diagnostic {
|
|
|
|
pub diag_type: DiagnosticType,
|
2024-01-17 00:04:22 +00:00
|
|
|
pub spans: Vec<SpanWithLabel>,
|
|
|
|
pub message: String,
|
2024-01-16 22:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
|
|
pub enum DiagnosticType {
|
|
|
|
Error,
|
|
|
|
Warning,
|
2024-01-17 00:04:22 +00:00
|
|
|
Help,
|
|
|
|
SecondaryError
|
2024-01-16 22:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
pub struct SpanWithLabel {
|
|
|
|
pub span: Span,
|
|
|
|
pub span_type: DiagnosticType,
|
|
|
|
pub label: Option<String>,
|
|
|
|
}
|