json(vm): fix birth dispatch; unify constructor naming (Box.birth/N); JsonNode factories return JsonNodeInstance; quick: enable heavy JSON with probe; builder: NYASH_BUILDER_DEBUG_LIMIT guard; json_query_min(core) harness; docs/tasks updated

This commit is contained in:
nyash-codex
2025-09-27 08:45:25 +09:00
parent fcf8042b06
commit cb236b7f5a
263 changed files with 12990 additions and 272 deletions

View File

@ -15,7 +15,8 @@ box JsonTokenizer {
birth(input_text) {
// Avoid static module wrapper to ensure constructor args are preserved on VM path
// (create_scanner(...) lost the argument under VM fallback in some cases)
me.scanner = new JsonScanner(input_text)
me.scanner = new JsonScanner("")
me.scanner.reset_text(input_text)
me.tokens = new ArrayBox()
me.errors = new ArrayBox()
}
@ -60,6 +61,14 @@ box JsonTokenizer {
return me.tokens
}
// Explicitly set input text (guards against constructor-arg loss)
set_input(input_text) {
if me.scanner == null {
me.scanner = new JsonScanner("")
}
me.scanner.reset_text(input_text)
}
// 次のトークンを1つ取得
next_token() {