test: Phase 133 P0 - Promoted carrier join_id test fixture (JsonParser pattern)

This commit is contained in:
nyash-codex
2025-12-15 12:35:59 +09:00
parent aad01a1079
commit ae59409282

View File

@ -0,0 +1,29 @@
// Phase 133 P0: Promoted carrier join_id test (JsonParser._skip_whitespace pattern)
// 目的: Loop + promoted carrier の join_id 問題を検証・修正Phase 133課題
// Issue: promoted carrier 'is_char_match' has no join_id when break is used
// Pattern: [cond_promoter] A-3 Trim pattern promoted → [phase229] no join_id error
// Input: " X" (3 spaces + character)
// Expected: return 3 (count of leading spaces before first non-space)
// Verification: exit code (VM: RC, LLVM EXE: exit code)
static box Main {
countSpaces(s) {
local count = 0
local index = 0
loop(index < s.length()) {
local char = s.substring(index, index + 1)
if char == " " {
count = count + 1
index = index + 1
} else {
break
}
}
return count
}
main() {
local input = " X"
return me.countSpaces(input) // Expected: 3
}
}