Files
hakorune/apps/tests/loopform_nested_region.hako
nyash-codex 6865f4acfa feat(phi): Phase 25.1 - LoopForm v2 テスト・最小再現ケース追加
-  最小再現ケース作成
  - apps/tests/minimal_ssa_skip_ws.hako: 確実に再現する10-30行ケース
  - apps/tests/minimal_ssa_bug*.hako: 段階的簡略化版
  - apps/tests/loopform_*.hako: LoopForm v2 各ケーステスト

-  Rustテストスイート追加
  - src/tests/mir_loopform_conditional_reassign.rs: 4ケース(Case A/B/C/D)
  - src/tests/mir_loopform_complex.rs: 複雑なパターン
  - 全テストPASS確認済み

-  SSAバグ分析ドキュメント
  - docs/development/analysis/minimal_ssa_bug_analysis.md
  - エラー詳細・原因・ワークアラウンド記録

🎯 成果: SSAバグの構造を完全特定、デバッグ準備完了
2025-11-21 06:21:45 +09:00

40 lines
894 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// loopform_nested_region.hako
// 目的: 外側 Loop + 内側 Region 型 Loop のネストをスモークする
static box Main {
find_first_non_space(lines) {
local line_idx = 0
local n = lines.size()
// outer loop: 行単位
loop(line_idx < n) {
local line = lines.get(line_idx)
local col = 0
// inner loop: 行内の先頭非空白を探すRegion+next_col 風)
loop(1 == 1) {
if col >= line.length() { break }
local ch = line.substring(col, col + 1)
if ch == " " {
col = col + 1
continue
}
break
}
if col < line.length() { return line_idx }
line_idx = line_idx + 1
}
return -1
}
main(args) {
local lines = new ArrayBox()
lines.push(" ")
lines.push(" xx")
local r = Main.find_first_non_space(lines)
print(r)
return 0
}
}