refactor(joinir): Pattern 3 ExitMeta化 - Hardcoded ValueIds削除
Refactoring 5.1: Pattern 3 を Pattern 4 と同じ ExitMeta ベースアーキテクチャに統一化
Changes:
1. loop_with_if_phi_minimal.rs
- 署名: Option<JoinModule> → Result<(JoinModule, JoinFragmentMeta), String>
- ExitMeta 動的生成ロジック追加(sum, count)
- インポート追加: carrier_info::{ExitMeta, JoinFragmentMeta}
2. pattern3_with_if_phi.rs
- Hardcoded 定数削除(PATTERN3_K_EXIT_*_ID 2個削除)
- Manual exit binding 42行 → ExitMetaCollector 4行に置き換え
- インポート追加: ExitMetaCollector
3. loop_patterns/with_if_phi.rs
- Result型変更に対応(.ok()? で変換)
Benefits:
- Pattern 3/4 アーキテクチャ統一化 ✅
- 19行純削減(+55 -74行、3ファイル合計) ✅
- Hardcoded ValueIds 完全撤廃 ✅
- Phase 213 AST-based generalization の基盤強化 ✅
Tests: All tests passing, loop_if_phi.hako outputs "sum=9" correctly
This commit is contained in:
@ -110,7 +110,8 @@ pub fn lower_loop_with_conditional_phi_to_joinir(
|
||||
let mut join_value_space = JoinValueSpace::new();
|
||||
|
||||
// Generate JoinIR module
|
||||
let _join_module = lower_loop_with_if_phi_pattern(placeholder_scope, &mut join_value_space)?;
|
||||
// Phase 213: Updated to handle Result<(JoinModule, JoinFragmentMeta), String>
|
||||
let _result = lower_loop_with_if_phi_pattern(placeholder_scope, &mut join_value_space).ok()?;
|
||||
|
||||
// Phase 188-Impl-3: Pattern 3 is now integrated via the router
|
||||
// This function delegates to loop_with_if_phi_minimal which generates JoinModule
|
||||
|
||||
Reference in New Issue
Block a user