Skip to content

Commit

Permalink
fix: decl file generation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Jan 19, 2025
1 parent 1aa3f53 commit b52b017
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/py2erg/gen_decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use erg_common::set::Set;
use erg_common::traits::LimitedDisplay;
use erg_common::{log, Str};
use erg_compiler::build_package::{CheckStatus, PylyzerStatus};
use erg_compiler::context::ControlKind;
use erg_compiler::hir::{ClassDef, Expr, HIR};
use erg_compiler::module::SharedModuleCache;
use erg_compiler::ty::value::{GenTypeObj, TypeObj};
Expand Down Expand Up @@ -182,6 +183,26 @@ impl DeclFileGenerator {
self.gen_chunk_decl(chunk);
}
}
Expr::Compound(compound) => {
for chunk in compound.iter() {
self.gen_chunk_decl(chunk);
}
}
Expr::Call(call)
if call
.obj
.show_acc()
.is_some_and(|acc| ControlKind::try_from(&acc[..]).is_ok()) =>
{
for arg in call.args.iter() {
self.gen_chunk_decl(arg);
}
}
Expr::Lambda(lambda) => {
for arg in lambda.body.iter() {
self.gen_chunk_decl(arg);
}
}
_ => {}
}
self.code.push('\n');
Expand Down

0 comments on commit b52b017

Please sign in to comment.