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>
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>