mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
Add: Location
moved to ErrorCore
This commit is contained in:
parent
000124fea8
commit
4ae81aa05e
6 changed files with 80 additions and 6 deletions
|
@ -501,6 +501,7 @@ pub struct ErrorCore {
|
|||
pub main_message: AtomicStr,
|
||||
pub errno: usize,
|
||||
pub kind: ErrorKind,
|
||||
pub loc: Location,
|
||||
theme: Theme,
|
||||
}
|
||||
|
||||
|
@ -510,26 +511,25 @@ impl ErrorCore {
|
|||
main_message: S,
|
||||
errno: usize,
|
||||
kind: ErrorKind,
|
||||
loc: Location,
|
||||
) -> Self {
|
||||
Self {
|
||||
sub_messages,
|
||||
main_message: main_message.into(),
|
||||
errno,
|
||||
kind,
|
||||
loc,
|
||||
theme: THEME,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sub_messages(&self) -> &Vec<SubMessage> {
|
||||
&self.sub_messages
|
||||
}
|
||||
|
||||
pub fn dummy(errno: usize) -> Self {
|
||||
Self::new(
|
||||
vec![SubMessage::only_loc(Location::Line(errno as usize))],
|
||||
"<dummy>",
|
||||
errno,
|
||||
DummyError,
|
||||
Location::Line(errno as usize),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -555,6 +555,7 @@ impl ErrorCore {
|
|||
&m_msg,
|
||||
errno,
|
||||
CompilerSystemError,
|
||||
loc,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue