test: Phase 102 real-app read_quoted fixture + VM/LLVM smokes

This commit is contained in:
nyash-codex
2025-12-17 16:57:11 +09:00
parent d859e46163
commit 5b4f9c25e4
3 changed files with 208 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// Phase 102: real-app loop fixture (MiniJsonLoader.read_quoted_from)
// Goal: Fix accumulator + escape (+2) + quote-break in Pattern2/JoinIR, and keep VM/LLVM EXE parity.
static box Main {
read_quoted_min(s, pos) {
local i = pos
if s.substring(i, i+1) != "\"" { return "" }
i = i + 1
local out = ""
local n = s.length()
loop (i < n) {
local ch = s.substring(i, i+1)
if ch == "\"" { break }
if ch == "\\" { i = i + 1 ch = s.substring(i, i+1) }
out = out + ch
i = i + 1
}
return out
}
main() {
local s = "\"ab\\\"c\""
local out = me.read_quoted_min(s, 0)
print(out.length())
return "OK"
}
}