Skip to content

Commit

Permalink
Update transpile.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Oct 11, 2023
1 parent b2415c4 commit a71c908
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/erg_compiler/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use erg_parser::token::TokenKind;
use crate::artifact::{
BuildRunnable, Buildable, CompleteArtifact, ErrorArtifact, IncompleteArtifact,
};
use crate::build_hir::HIRBuilder;
use crate::build_package::PackageBuilder;
use crate::codegen::PyCodeGenerator;
use crate::context::{Context, ContextProvider, ModuleContext};
use crate::desugar_hir::HIRDesugarer;
Expand Down Expand Up @@ -140,7 +140,7 @@ pub struct Json {
#[derive(Debug)]
pub struct Transpiler {
pub cfg: ErgConfig,
builder: HIRBuilder,
builder: PackageBuilder,
shared: SharedCompilerResource,
script_generator: PyScriptGenerator,
}
Expand All @@ -160,7 +160,7 @@ impl Runnable for Transpiler {
let shared = SharedCompilerResource::new(cfg.copy());
Self {
shared: shared.clone(),
builder: HIRBuilder::new_with_cache(cfg.copy(), "<module>", shared),
builder: PackageBuilder::new_with_cache(cfg.copy(), "<module>".into(), shared),
script_generator: PyScriptGenerator::new(),
cfg,
}
Expand Down Expand Up @@ -264,7 +264,7 @@ impl Transpiler {
pub fn new_with_cache(cfg: ErgConfig, mod_name: Str, shared: SharedCompilerResource) -> Self {
Self {
shared: shared.clone(),
builder: HIRBuilder::new_with_cache(cfg.copy(), mod_name, shared),
builder: PackageBuilder::new_with_cache(cfg.copy(), mod_name, shared),
script_generator: PyScriptGenerator::new(),
cfg,
}
Expand Down Expand Up @@ -333,7 +333,7 @@ impl Transpiler {
}

pub fn pop_mod_ctx(&mut self) -> Option<ModuleContext> {
self.builder.pop_mod_ctx()
self.builder.pop_context()
}

pub fn dir(&mut self) -> HashMap<&VarName, &VarInfo> {
Expand Down

0 comments on commit a71c908

Please sign in to comment.