mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00
20 lines
466 B
Rust
20 lines
466 B
Rust
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)]
|
|
pub struct CompilerDiagnostic {
|
|
pub message: String,
|
|
pub offset: usize,
|
|
}
|
|
|
|
#[derive(Default, Debug)]
|
|
pub struct Diagnostics {
|
|
pub inner: Vec<CompilerDiagnostic>,
|
|
}
|
|
|
|
impl Diagnostics {
|
|
pub fn push_error(&mut self, message: String, offset: usize) {
|
|
self.inner.push(CompilerDiagnostic { message, offset });
|
|
}
|
|
|
|
pub fn has_error(&self) -> bool {
|
|
!self.inner.is_empty()
|
|
}
|
|
}
|