Integrate ParseError to compiler-core::Error

This commit is contained in:
Jeong YunWon 2022-08-22 09:07:15 +09:00
parent 904fc477f1
commit 2b7bf79d29
5 changed files with 67 additions and 32 deletions

22
core/src/error.rs Normal file
View file

@ -0,0 +1,22 @@
use crate::Location;
#[derive(Debug, PartialEq, Eq)]
pub struct Error<T> {
pub error: T,
pub location: Location,
pub source_path: String,
}
impl<T> std::ops::Deref for Error<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&self.error
}
}
impl<T> Error<T> {
pub fn error(self) -> T {
self.error
}
}