refactor(joinir): Extract carrier_update_emitter from loop_with_break_minimal

Phase 179 Task 1: Modular separation for single responsibility

Changes:
- NEW: carrier_update_emitter.rs (416 lines)
  - emit_carrier_update() function + 6 unit tests
  - Focused module for UpdateExpr → JoinInst conversion
- REDUCED: loop_with_break_minimal.rs (998→597 lines, -401 lines)
  - Removed emit_carrier_update() and carrier_update_tests module
  - Now imports from carrier_update_emitter
- UPDATED: mod.rs - added carrier_update_emitter module

Benefits:
- Single responsibility: carrier update emission isolated
- Reusability: can be used by Pattern 3, 4, and future patterns
- Testability: independent unit tests
- Maintainability: 40% size reduction in loop_with_break_minimal.rs

Note: Pre-existing test failure in test_pattern2_accepts_loop_param_only
is unrelated to this refactoring (test expects 1 var but gets 3 due to
literal "10" and "5" being counted as variables).
This commit is contained in:
nyash-codex
2025-12-08 19:03:30 +09:00
parent 4e7f7f1334
commit 0dc9b838d6
3 changed files with 420 additions and 404 deletions

View File

@ -21,6 +21,7 @@
pub mod bool_expr_lowerer; // Phase 168: Boolean expression lowering for complex conditions
pub mod carrier_info; // Phase 196: Carrier metadata for loop lowering
pub mod carrier_update_emitter; // Phase 179: Carrier update instruction emission
pub mod common;
pub mod condition_env; // Phase 171-fix: Condition expression environment
pub mod condition_lowerer; // Phase 171-fix: Core condition lowering logic