feat(joinir): detect mutable accumulator pattern (AST-only, spec minimal)

- Implement MutableAccumulatorAnalyzer in loop_pattern_detection/
- Detect shape: target = target + x (Add only, x ∈ {Var, Literal})
- Does NOT check read-only (delegated to ScopeManager)
- Multiple assignments → return None (not our pattern, let other code handle it)
- 6 unit tests covering OK/NG cases
- Error prefix: [joinir/mutable-acc-spec]

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-17 06:10:38 +09:00
parent b45035597d
commit 8a40b5700a
2 changed files with 421 additions and 0 deletions

View File

@ -746,4 +746,8 @@ pub mod binding_map_provider;
// Phase 100 P1-2: Pinned Local Analyzer
pub mod pinned_local_analyzer;
// Phase 100 P2-1: Mutable Accumulator Analyzer
pub mod mutable_accumulator_analyzer;
pub use binding_map_provider::BindingMapProvider;