mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
chore: let HIRBuilder/ASTLowerer
be generic
This commit is contained in:
parent
f4fcf3f2b2
commit
51c7b0778d
10 changed files with 126 additions and 75 deletions
|
@ -186,6 +186,15 @@ impl From<ParserRunnerError> for CompileError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<CompileError> for ParserRunnerError {
|
||||
fn from(err: CompileError) -> Self {
|
||||
Self {
|
||||
core: *err.core,
|
||||
input: err.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ErrorDisplay for CompileError {
|
||||
fn core(&self) -> &ErrorCore {
|
||||
&self.core
|
||||
|
@ -512,6 +521,12 @@ impl From<ParserRunnerErrors> for CompileErrors {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<CompileErrors> for ParserRunnerErrors {
|
||||
fn from(err: CompileErrors) -> Self {
|
||||
Self::new(err.into_iter().map(|e| e.into()).collect())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec<CompileError>> for CompileErrors {
|
||||
fn from(errs: Vec<CompileError>) -> Self {
|
||||
Self(errs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue