docs: Phase 136/137 - return literal and add expression documentation
Phase 136 Documentation: - Created docs/development/current/main/phases/phase-136/README.md - Goal: loop(true) break-once with return literal (Integer) - Supported: return 7, loop + post + return literal - Implementation: lower_return_value_to_vid() method - Tests: 2 fixtures + 4 smokes - VM/LLVM EXE parity verification commands Phase 137 Documentation: - Created docs/development/current/main/phases/phase-137/README.md - Goal: loop(true) break-once with return add expression - Supported: return x+2, return 5+3, loop+post+return add - Implementation: Extended lower_return_value_to_vid() for BinaryOp Add - Return Value Lowering SSOT documented (lines 29-46) - Boxification trigger: when 2+ files need identical logic - Tests: 3 fixtures + 6 smokes - VM/LLVM EXE parity verification commands 10-Now.md Updates: - Added Phase 136 entry (return literal) - Added Phase 137 entry (return add expression) - Implementation details and test coverage - Links to phase READMEs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,5 +1,62 @@
|
||||
# Self Current Task — Now (main)
|
||||
|
||||
## 2025-12-18:Phase 137 完了 ✅
|
||||
|
||||
**Phase 137: loop(true) break-once with return add expression**
|
||||
- 目的: Phase 136 を拡張し、return 時に最小 add 式をサポート
|
||||
- 仕様:
|
||||
- `return x + 2`(variable + integer literal)→ exit code 3
|
||||
- `return 5 + 3`(integer literal + integer literal)→ exit code 8
|
||||
- `loop(true) { x = 1; break }; x = x + 10; return x + 2` → exit code 13
|
||||
- 実装:
|
||||
- `src/mir/control_tree/normalized_shadow/loop_true_break_once.rs`(`lower_return_value_to_vid()` 行 638-743, BinaryOp Add at 行 673)
|
||||
- BinaryOp Add パターン追加(LHS: Variable or Integer literal, RHS: Integer literal only)
|
||||
- Ok(None) fallback for out-of-scope patterns(`return x + y`, `return x - 2` 等)
|
||||
- Return Value Lowering SSOT:
|
||||
- Documentation: `loop_true_break_once.rs`(行 29-46, module-level comment)
|
||||
- Boxification trigger: 2+ files で同一 return lowering logic が必要になった時
|
||||
- Fixtures:
|
||||
- `phase137_loop_true_break_once_return_add_min.hako`(期待: exit code 3)
|
||||
- `phase137_loop_true_break_once_return_add_const_min.hako`(期待: exit code 8)
|
||||
- `phase137_loop_true_break_once_post_return_add_min.hako`(期待: exit code 13)
|
||||
- Smoke tests:
|
||||
- VM: 3/3 PASS
|
||||
- LLVM EXE: 3/3 PASS
|
||||
- Regression:
|
||||
- Phase 97: 2/2 PASS(next_non_ws, json_loader_escape)
|
||||
- Phase 131/135/136: 3/3 PASS
|
||||
- 設計判断(Approach A 採用):
|
||||
- 直接拡張(boxification なし)、変更スコープ小
|
||||
- post_if_post_k.rs は未変更(責任分離)
|
||||
- 入口: `docs/development/current/main/phases/phase-137/README.md`
|
||||
|
||||
---
|
||||
|
||||
## 2025-12-18:Phase 136 完了 ✅
|
||||
|
||||
**Phase 136: loop(true) break-once with return literal**
|
||||
- 目的: Phase 131-135 を拡張し、return integer literal をサポート
|
||||
- 仕様:
|
||||
- `loop(true) { x = 1; break }; return 7` → exit code 7
|
||||
- `loop(true) { x = 1; break }; x = x + 2; return 7` → exit code 7
|
||||
- PHI禁止維持、dev-only、既定挙動不変
|
||||
- 実装:
|
||||
- `src/mir/control_tree/normalized_shadow/loop_true_break_once.rs`(`lower_return_value_to_vid()` 行 638-743, Integer literal at 行 661)
|
||||
- Integer literal パターン: Const generation(Phase 123 パターン再利用)
|
||||
- Ok(None) fallback for out-of-scope patterns(`return "hello"`, `return 3.14` 等)
|
||||
- Fixtures:
|
||||
- `phase136_loop_true_break_once_return_literal_min.hako`(期待: exit code 7)
|
||||
- `phase136_loop_true_break_once_post_return_literal_min.hako`(期待: exit code 7)
|
||||
- Smoke tests:
|
||||
- VM: 2/2 PASS
|
||||
- LLVM EXE: 2/2 PASS
|
||||
- Regression:
|
||||
- Phase 131: 2/2 PASS
|
||||
- Phase 135: 2/2 PASS
|
||||
- 入口: `docs/development/current/main/phases/phase-136/README.md`
|
||||
|
||||
---
|
||||
|
||||
## 2025-12-18:Phase 135 P0 完了 ✅
|
||||
|
||||
**Phase 135 P0: Normalization Plan Suffix Detection Generalization**
|
||||
|
||||
Reference in New Issue
Block a user