feat(joinir): Phase 192-impl ComplexAddendNormalizer implementation

- New module: complex_addend_normalizer.rs (320 lines, 5 unit tests)
- Transforms `result = result * 10 + f(x)` into temp variable pattern
- Pattern2 preprocessing integration (~40 lines added)
- Zero changes to emission layers (reuses Phase 191 + Phase 190)

Tests:
- Unit tests: 5/5 passing (normalization logic)
- Regression: phase190/191 tests all pass
- Demo: phase192_normalization_demo.hako → 123

Limitation: Full E2E requires Phase 193 (MethodCall in init)

🤖 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-09 04:20:28 +09:00
parent b7bf4a721e
commit 4f94309548
7 changed files with 705 additions and 6 deletions

View File

@ -23,6 +23,7 @@ pub(crate) mod bool_expr_lowerer; // Phase 168: Boolean expression lowering (unu
pub mod carrier_info; // Phase 196: Carrier metadata for loop lowering
pub(crate) mod carrier_update_emitter; // Phase 179: Carrier update instruction emission
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 loop_body_local_env; // Phase 184: Body-local variable environment
pub mod loop_body_local_init; // Phase 186: Body-local init expression lowering