fix(joinir): Phase 219 regression fix - ConditionPatternBox

Introduced ConditionPatternBox to detect if condition complexity:
- Simple comparisons (var CmpOp literal): use AST-based if-sum lowerer
- Complex conditions (BinaryOp, etc.): fallback to legacy P3 lowerer

This fixes loop_if_phi.hako which was broken by Phase 219's
is_if_sum_pattern() changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-10 03:54:17 +09:00
parent 8f7c6c5637
commit d0d2a30c56
3 changed files with 270 additions and 6 deletions

View File

@ -25,6 +25,7 @@ pub(crate) mod carrier_update_emitter; // Phase 179: Carrier update instruction
pub(crate) mod common; // Internal lowering utilities
pub mod complex_addend_normalizer; // Phase 192: Complex addend normalization (AST preprocessing)
pub mod condition_env; // Phase 171-fix: Condition expression environment
pub mod condition_pattern; // Phase 219-fix: If condition pattern detection (simple vs complex)
pub mod loop_body_local_env; // Phase 184: Body-local variable environment
pub mod loop_body_local_init; // Phase 186: Body-local init expression lowering
pub(crate) mod condition_lowerer; // Phase 171-fix: Core condition lowering logic