mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +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
|
@ -6,7 +6,7 @@ use erg_common::Str;
|
|||
use erg_parser::ast::{VarName, AST};
|
||||
use erg_parser::build_ast::ASTBuilder;
|
||||
|
||||
use crate::artifact::{CompleteArtifact, IncompleteArtifact};
|
||||
use crate::artifact::{Buildable, CompleteArtifact, IncompleteArtifact};
|
||||
use crate::context::{Context, ContextProvider};
|
||||
use crate::effectcheck::SideEffectChecker;
|
||||
use crate::error::{CompileError, CompileErrors};
|
||||
|
@ -72,6 +72,18 @@ impl Runnable for HIRBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
impl Buildable for HIRBuilder {
|
||||
fn build(&mut self, src: String, mode: &str) -> Result<CompleteArtifact, IncompleteArtifact> {
|
||||
self.build(src, mode)
|
||||
}
|
||||
fn pop_context(&mut self) -> Option<Context> {
|
||||
Some(self.pop_mod_ctx())
|
||||
}
|
||||
fn get_context(&self) -> Option<&Context> {
|
||||
Some(&self.lowerer.ctx)
|
||||
}
|
||||
}
|
||||
|
||||
impl ContextProvider for HIRBuilder {
|
||||
fn dir(&self) -> Vec<(&VarName, &VarInfo)> {
|
||||
self.lowerer.dir()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue