Files
hakorune/apps/tests
nyash-codex ff09adebe0 feat(control_tree): Phase 136/137 - return literal and add expression (dev-only)
Phase 136 P0: Return literal (Integer) support
- Extend loop(true) break-once to support `return 7`
- Fixtures: phase136_loop_true_break_once_return_literal_min.hako (exit code 7)
- VM/LLVM EXE parity achieved

Phase 137 P0: Return add expression support
- Extend to support `return x + 2` and `return 5 + 3`
- LHS: Variable or Integer literal
- RHS: Integer literal only
- 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)
- VM/LLVM EXE parity achieved

Implementation:
- Added lower_return_value_to_vid() method in loop_true_break_once.rs
- Replaced extract_variable_name() with unified return value lowering
- Supported patterns: Variable, Integer literal, BinaryOp Add
- Out-of-scope patterns return Ok(None) for fallback
- SSOT documentation added (lines 29-46)

Tests: 5 fixtures + 10 smoke tests (5 VM + 5 LLVM EXE), all PASS

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 00:15:32 +09:00
..

Nyash Test Programs

このディレクトリには、CI/CDやデバッグ用のテストプログラムが含まれています。 実用的なアプリケーションは親ディレクトリ(apps/)にあります。

テストプログラム一覧

LLVMバックエンドテスト

  • ny-llvm-smoke/ - ArrayBox基本操作テスト
  • ny-array-llvm-ret/ - ArrayBox戻り値テスト
  • ny-echo-lite/ - 最小echo実装I/Oテスト
  • ny-map-llvm-smoke/ - MapBoxプラグインテスト
  • ny-vinvoke-smoke/ - 可変長引数5引数テスト
  • ny-vinvoke-llvm-ret/ - 可変長引数戻り値テスト
  • ny-vinvoke-llvm-ret-size/ - 固定長引数size())テスト

実行方法

これらのテストは主に tools/llvm_smoke.sh から実行されます:

# 環境変数でテストを有効化
NYASH_LLVM_MAP_SMOKE=1 ./tools/llvm_smoke.sh
NYASH_LLVM_VINVOKE_RET_SMOKE=1 ./tools/llvm_smoke.sh

注意事項

  • これらは最小限の機能テストであり、実用的なアプリケーションではありません
  • CIでの自動テストを前提に設計されています
  • エラー時の切り分けが容易になるよう、各テストは単一の機能に焦点を当てています