Commit Graph

3 Commits

Author SHA1 Message Date
d4f90976da refactor(joinir): Phase 244 - ConditionLoweringBox trait unification
Unify condition lowering logic across Pattern 2/4 with trait-based API.

New infrastructure:
- condition_lowering_box.rs: ConditionLoweringBox trait + ConditionContext (293 lines)
- ExprLowerer implements ConditionLoweringBox trait (+51 lines)

Pattern migrations:
- Pattern 2 (loop_with_break_minimal.rs): Use trait API
- Pattern 4 (loop_with_continue_minimal.rs): Use trait API

Benefits:
- Unified condition lowering interface
- Extensible for future lowering strategies
- Clean API boundary between patterns and lowering logic
- Zero code duplication

Test results: 911/911 PASS (+2 new tests)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 02:35:31 +09:00
13a676d406 feat(joinir): Phase 231 - ExprLowerer/ScopeManager pilot implementation
Pilot implementation of unified expression lowering for Pattern2 break conditions:

New files:
- scope_manager.rs (280 lines) - ScopeManager trait + Pattern2ScopeManager
- expr_lowerer.rs (455 lines) - ExprLowerer with Condition context support

Features:
- Unified variable lookup across ConditionEnv/LoopBodyLocalEnv/CapturedEnv/CarrierInfo
- Pre-validation of condition AST before lowering
- Fail-safe design with fallback to legacy path
- 8 new unit tests (all pass)

Integration:
- Pattern2 break condition uses ExprLowerer for pre-validation
- Existing proven lowering path preserved
- Zero impact on existing functionality (890/897 tests pass)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:48:45 +09:00
b07329b37f feat(joinir): Phase 224-E - DigitPos condition normalization
Add DigitPosConditionNormalizer to transform integer comparison to boolean:
- `digit_pos < 0` → `!is_digit_pos`

This eliminates the type error caused by comparing Bool carrier with Integer:
- Before: Bool(is_digit_pos) < Integer(0) → Type error
- After: !is_digit_pos → Boolean expression, no type mismatch

Implementation:
- New Box: digitpos_condition_normalizer.rs (173 lines)
- Pattern2 integration: normalize after promotion success
- 5 unit tests (all pass)
- E2E test passes (type error eliminated)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:10:28 +09:00