From a71c908df5893e862c12d1baca0a115aae05d9cd Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 11 Oct 2023 13:12:20 +0900 Subject: [PATCH] Update transpile.rs --- crates/erg_compiler/transpile.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/erg_compiler/transpile.rs b/crates/erg_compiler/transpile.rs index 84023eb4b..80b93c653 100644 --- a/crates/erg_compiler/transpile.rs +++ b/crates/erg_compiler/transpile.rs @@ -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; @@ -140,7 +140,7 @@ pub struct Json { #[derive(Debug)] pub struct Transpiler { pub cfg: ErgConfig, - builder: HIRBuilder, + builder: PackageBuilder, shared: SharedCompilerResource, script_generator: PyScriptGenerator, } @@ -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(), "", shared), + builder: PackageBuilder::new_with_cache(cfg.copy(), "".into(), shared), script_generator: PyScriptGenerator::new(), cfg, } @@ -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, } @@ -333,7 +333,7 @@ impl Transpiler { } pub fn pop_mod_ctx(&mut self) -> Option { - self.builder.pop_mod_ctx() + self.builder.pop_context() } pub fn dir(&mut self) -> HashMap<&VarName, &VarInfo> {