feat(joinir/refactor): Phase 33-10-P1 ExitMetaCollector Box modularization

Box theory refactoring: Extract exit_bindings construction logic from
pattern lowerers into focused, reusable ExitMetaCollector Box.

**Changes**:
1. Created meta_collector.rs (+102 lines):
   - ExitMetaCollector::collect() builds exit_bindings from ExitMeta
   - Pure function (no side effects)
   - Reusable by all pattern lowerers

2. Updated pattern2_with_break.rs (-20 lines):
   - Use ExitMetaCollector::collect() instead of inline filter_map
   - Removed manual binding construction loop
   - Cleaner caller code

3. Made exit_line module public:
   - Allows pattern lowerers to use ExitMetaCollector
   - Clear module visibility boundaries

**Box Design**:
- Single responsibility: Convert ExitMeta + variable_map → exit_bindings
- Pure function: No side effects, testable independently
- Reusable: Can be used by Pattern 3, Pattern 4, etc.

**Testing**:
- Build:  Success (1m 04s)
- Execution:  RC: 0 (Pattern 2 verified)
- Regression:  No issues

**Metrics**:
- New lines: +102 (meta_collector.rs)
- Removed lines: -20 (pattern2_with_break.rs)
- Net change: +82 lines
- Code clarity: Significantly improved

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-07 02:37:12 +09:00
parent 547be29a1f
commit eabef39748
4 changed files with 127 additions and 23 deletions

View File

@ -16,7 +16,7 @@ mod block_allocator;
mod value_collector;
mod instruction_rewriter;
mod exit_phi_builder;
mod exit_line;
pub mod exit_line;
use crate::mir::{MirModule, ValueId};
use crate::mir::join_ir::lowering::inline_boundary::JoinInlineBoundary;