This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
huia/huia-compiler/src/error.rs
2019-03-13 20:32:13 +13:00

21 lines
408 B
Rust

use crate::location::Location;
use std::error::Error;
use std::fmt;
#[derive(Debug)]
pub struct CompileError {
message: String,
location: Location,
}
impl fmt::Display for CompileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Compile Error: {:?}", self)
}
}
impl Error for CompileError {
fn description(&self) -> &str {
&self.message
}
}