#[derive(Debug)]
pub struct CompileError {
pub message: String,
pub path: Option<String>,
pub line: Option<u32>,
pub column: Option<u32>,
}
impl CompileError {
pub(crate) fn new(message: impl Into<String>) -> Self {
Self {
message: message.into(),
path: None,
line: None,
column: None,
}
}
}
impl std::fmt::Display for CompileError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.message)
}
}
impl std::error::Error for CompileError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
None
}
}