mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-30 15:18:02 +00:00
Integrate ParseError to compiler-core::Error
This commit is contained in:
parent
904fc477f1
commit
2b7bf79d29
5 changed files with 67 additions and 32 deletions
22
core/src/error.rs
Normal file
22
core/src/error.rs
Normal 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue