docs: Add control_flow modularization to CLAUDE.md
- Document 17-module structure with complete directory tree - Record 50% line reduction achievement (312 → 187 lines in mod.rs) - List all 7 modularization phases - Add navigation link to architecture section - Total module count: 2,129 lines across 17 files
This commit is contained in:
46
CLAUDE.md
46
CLAUDE.md
@ -1102,6 +1102,7 @@ Read docs/reference/ # まずドキュメント(API/言語仕様の入口)
|
|||||||
- **[名前空間・using system](docs/reference/language/using.md)** ⭐超重要 - ドット記法・スコープ演算子・Phase 15.5計画
|
- **[名前空間・using system](docs/reference/language/using.md)** ⭐超重要 - ドット記法・スコープ演算子・Phase 15.5計画
|
||||||
- **[MIR Callee革新](docs/development/architecture/mir-callee-revolution.md)** - 関数呼び出し型安全化・シャドウイング解決
|
- **[MIR Callee革新](docs/development/architecture/mir-callee-revolution.md)** - 関数呼び出し型安全化・シャドウイング解決
|
||||||
- **[構文早見表](docs/quick-reference/syntax-cheatsheet.md)** - 基本構文・よくある間違い
|
- **[構文早見表](docs/quick-reference/syntax-cheatsheet.md)** - 基本構文・よくある間違い
|
||||||
|
- **[Control Flow モジュール化](#-control_flow-モジュール構造-2025-12-05完了)** - 1,632行→17モジュール完全分離
|
||||||
|
|
||||||
### 📋 **Phase 15.5重要資料**
|
### 📋 **Phase 15.5重要資料**
|
||||||
- **[Core Box統一計画](docs/private/roadmap2/phases/phase-15.5/README.md)** - builtin vs plugin問題
|
- **[Core Box統一計画](docs/private/roadmap2/phases/phase-15.5/README.md)** - builtin vs plugin問題
|
||||||
@ -1113,6 +1114,51 @@ Read docs/reference/ # まずドキュメント(API/言語仕様の入口)
|
|||||||
- **[プラグインシステム](docs/reference/plugin-system/)** - プラグイン開発ガイド
|
- **[プラグインシステム](docs/reference/plugin-system/)** - プラグイン開発ガイド
|
||||||
- **[Phase 15 INDEX](docs/private/roadmap2/phases/phase-15/INDEX.md)** - 現在進捗
|
- **[Phase 15 INDEX](docs/private/roadmap2/phases/phase-15/INDEX.md)** - 現在進捗
|
||||||
|
|
||||||
|
### 🗂️ **control_flow モジュール構造** (2025-12-05完了)
|
||||||
|
|
||||||
|
**元の状態**: 単一ファイル 1,632行 (2025-12-04時点で312行まで削減済み)
|
||||||
|
**現在の状態**: 17モジュール 2,129行 (50%の行数削減達成!)
|
||||||
|
|
||||||
|
**ディレクトリ構造**:
|
||||||
|
```
|
||||||
|
src/mir/builder/control_flow/
|
||||||
|
├── mod.rs (187行) - メインエントリーポイント
|
||||||
|
├── debug.rs (23行) - デバッグユーティリティ
|
||||||
|
├── utils.rs (53行) - ヘルパー関数
|
||||||
|
├── exception/ - 例外処理
|
||||||
|
│ ├── mod.rs (36行)
|
||||||
|
│ ├── try_catch.rs (146行)
|
||||||
|
│ └── throw.rs (41行)
|
||||||
|
└── joinir/ - JoinIR統合
|
||||||
|
├── mod.rs (10行)
|
||||||
|
├── routing.rs (343行) - パターンルーティング
|
||||||
|
├── patterns/ - ループパターン
|
||||||
|
│ ├── mod.rs (10行)
|
||||||
|
│ ├── pattern1_minimal.rs (156行)
|
||||||
|
│ ├── pattern2_with_break.rs (127行)
|
||||||
|
│ └── pattern3_with_if_phi.rs (149行)
|
||||||
|
└── merge/ - MIRマージ
|
||||||
|
├── mod.rs (223行)
|
||||||
|
├── block_allocator.rs (70行)
|
||||||
|
├── value_collector.rs (90行)
|
||||||
|
├── instruction_rewriter.rs (405行)
|
||||||
|
└── exit_phi_builder.rs (60行)
|
||||||
|
```
|
||||||
|
|
||||||
|
**モジュール化フェーズ**:
|
||||||
|
- Phase 1: Debug utilities (debug.rs)
|
||||||
|
- Phase 2: Pattern lowerers (joinir/patterns/)
|
||||||
|
- Phase 3: JoinIR routing (joinir/routing.rs)
|
||||||
|
- Phase 4: Merge implementation (joinir/merge/)
|
||||||
|
- Phase 5: Exception handling (exception/)
|
||||||
|
- Phase 6: Utility functions (utils.rs)
|
||||||
|
- Phase 7: Documentation and cleanup
|
||||||
|
|
||||||
|
**設計哲学**:
|
||||||
|
- 委譲パターン: mod.rsがエントリーポイント、サブモジュールが実装
|
||||||
|
- 関心の分離: 各モジュールが単一の責務を持つ
|
||||||
|
- テスト容易性: モジュール分割により単体テスト可能
|
||||||
|
|
||||||
## 🔧 開発サポート
|
## 🔧 開発サポート
|
||||||
|
|
||||||
### 🎛️ 重要フラグ一覧(Phase 15)
|
### 🎛️ 重要フラグ一覧(Phase 15)
|
||||||
|
|||||||
Reference in New Issue
Block a user