mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
impl Buildable for HIRBuilder, Transpiler
This commit is contained in:
parent
87d13b8f09
commit
e07b0dfa67
3 changed files with 40 additions and 4 deletions
|
@ -2,6 +2,7 @@ use std::fmt;
|
|||
|
||||
use erg_common::traits::Stream;
|
||||
|
||||
use crate::context::Context;
|
||||
use crate::error::CompileErrors;
|
||||
use crate::hir::HIR;
|
||||
|
||||
|
@ -77,6 +78,12 @@ impl ErrorArtifact {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait Buildable {
|
||||
fn build(&mut self, src: String, mode: &str) -> Result<CompleteArtifact, IncompleteArtifact>;
|
||||
pub trait Buildable<T = HIR> {
|
||||
fn build(
|
||||
&mut self,
|
||||
src: String,
|
||||
mode: &str,
|
||||
) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>;
|
||||
fn pop_context(&mut self) -> Option<Context>;
|
||||
fn get_context(&self) -> Option<&Context>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue