refactor(joinir): L-2.2 Step-1 - Unify Stage-B lowering via LoopToJoinLowerer
Stage-B minimal JoinIR lowering統一化: 1. Add Case-A helpers to loop_to_join.rs: - lower_case_a_for_stageb_body (StageBBodyExtractorBox.build_body_src/2) - lower_case_a_for_stageb_funcscanner (StageBFuncScannerBox.scan_all_boxes/1) 2. Update stageb_body.rs and stageb_funcscanner.rs: - Replace manual LoopForm construction with construct_simple_while_loopform - Route through LoopToJoinLowerer like other Case-A functions - Remove unused imports (LoopForm, MirQuery) Now all 6 JoinIR lowering modules use the same unified pattern: - skip_ws, trim, append_defs, stage1_resolver, stageb_body, stageb_funcscanner All route through LoopToJoinLowerer for consistency. Test results: JSON snapshot 6/6 PASS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -339,6 +339,26 @@ impl LoopToJoinLowerer {
|
||||
) -> Option<JoinModule> {
|
||||
self.lower(func, loop_form, Some("Stage1UsingResolverBox.resolve_for_source/5"))
|
||||
}
|
||||
|
||||
/// Case-A 汎用 lowerer の「StageBBodyExtractorBox.build_body_src/2 用」薄いラッパー。
|
||||
/// 実際のロジックは `lower` に集約されている。
|
||||
pub fn lower_case_a_for_stageb_body(
|
||||
&self,
|
||||
func: &MirFunction,
|
||||
loop_form: &LoopForm,
|
||||
) -> Option<JoinModule> {
|
||||
self.lower(func, loop_form, Some("StageBBodyExtractorBox.build_body_src/2"))
|
||||
}
|
||||
|
||||
/// Case-A 汎用 lowerer の「StageBFuncScannerBox.scan_all_boxes/1 用」薄いラッパー。
|
||||
/// 実際のロジックは `lower` に集約されている。
|
||||
pub fn lower_case_a_for_stageb_funcscanner(
|
||||
&self,
|
||||
func: &MirFunction,
|
||||
loop_form: &LoopForm,
|
||||
) -> Option<JoinModule> {
|
||||
self.lower(func, loop_form, Some("StageBFuncScannerBox.scan_all_boxes/1"))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user