liquidex
2595bf0d82
introduce a new, more ergonomic syntax for haku not all features are implemented just yet. still missing: - custom tags (non-True/False) - color literals - lists
27 lines
438 B
Rust
27 lines
438 B
Rust
use alloc::string::String;
|
|
|
|
use crate::source::Span;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct Diagnostic {
|
|
span: Span,
|
|
message: String,
|
|
}
|
|
|
|
impl Diagnostic {
|
|
pub fn error(span: Span, message: impl Into<String>) -> Self {
|
|
Self {
|
|
span,
|
|
message: message.into(),
|
|
}
|
|
}
|
|
|
|
pub fn span(&self) -> Span {
|
|
self.span
|
|
}
|
|
|
|
pub fn message(&self) -> &str {
|
|
&self.message
|
|
}
|
|
}
|