feat(joinir): Phase 171-172 Issue 5 - ConditionEnvBuilder unified construction
Eliminates 40-50 lines of duplicated ConditionEnv + ConditionBinding construction in Pattern 2. **Changes**: - New: `condition_env_builder.rs` with factory methods - `build_for_break_condition()`: Extract condition variables, allocate JoinIR ValueIds, create bindings - `build_loop_param_only()`: Simple env with only loop parameter - Updated Pattern 2 to use unified builder - Includes 4 unit tests covering all usage scenarios **Impact**: - Pattern 2: 47 lines → 11 lines (36-line reduction, ~77%) - Preserved allocator closure for Trim pattern additions - Maintains mutability for downstream Trim pattern code **Test**: - cargo build --release: ✅ PASS - cargo test --release: ✅ 724/804 PASS (+4 improvements) - Unit tests: ✅ 4/4 PASS Phase 171-172 Stage 1: Total 66 lines reduced so far (Issue 4: 30 lines + Issue 5: 36 lines)
This commit is contained in:
@ -26,9 +26,11 @@
|
||||
//!
|
||||
//! Phase 171-172: Refactoring Infrastructure
|
||||
//! - loop_scope_shape_builder.rs: Unified LoopScopeShape initialization (Issue 4)
|
||||
//! - condition_env_builder.rs: Unified ConditionEnv construction (Issue 5)
|
||||
|
||||
pub(in crate::mir::builder) mod ast_feature_extractor;
|
||||
pub(in crate::mir::builder) mod common_init;
|
||||
pub(in crate::mir::builder) mod condition_env_builder;
|
||||
pub(in crate::mir::builder) mod conversion_pipeline;
|
||||
pub(in crate::mir::builder) mod exit_binding;
|
||||
pub(in crate::mir::builder) mod loop_scope_shape_builder;
|
||||
|
||||
Reference in New Issue
Block a user