Skip to content

Commit b52b017

Browse files
committed
fix: decl file generation bug
1 parent 1aa3f53 commit b52b017

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

crates/py2erg/gen_decl.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use erg_common::set::Set;
77
use erg_common::traits::LimitedDisplay;
88
use erg_common::{log, Str};
99
use erg_compiler::build_package::{CheckStatus, PylyzerStatus};
10+
use erg_compiler::context::ControlKind;
1011
use erg_compiler::hir::{ClassDef, Expr, HIR};
1112
use erg_compiler::module::SharedModuleCache;
1213
use erg_compiler::ty::value::{GenTypeObj, TypeObj};
@@ -182,6 +183,26 @@ impl DeclFileGenerator {
182183
self.gen_chunk_decl(chunk);
183184
}
184185
}
186+
Expr::Compound(compound) => {
187+
for chunk in compound.iter() {
188+
self.gen_chunk_decl(chunk);
189+
}
190+
}
191+
Expr::Call(call)
192+
if call
193+
.obj
194+
.show_acc()
195+
.is_some_and(|acc| ControlKind::try_from(&acc[..]).is_ok()) =>
196+
{
197+
for arg in call.args.iter() {
198+
self.gen_chunk_decl(arg);
199+
}
200+
}
201+
Expr::Lambda(lambda) => {
202+
for arg in lambda.body.iter() {
203+
self.gen_chunk_decl(arg);
204+
}
205+
}
185206
_ => {}
186207
}
187208
self.code.push('\n');

0 commit comments

Comments
 (0)