phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
12
apps/tests/dev_json_digits_from.hako
Normal file
12
apps/tests/dev_json_digits_from.hako
Normal file
@ -0,0 +1,12 @@
|
||||
using selfhost.vm.json as MiniJson
|
||||
|
||||
static box Main {
|
||||
main(args) {
|
||||
local json = "{\"kind\":\"Program\",\"statements\":[{\"kind\":\"Print\",\"expression\":{\"kind\":\"Literal\",\"value\":{\"type\":\"int\",\"value\":42}}}]}"
|
||||
local k = "\"value\":"
|
||||
local p = json.indexOf(k)
|
||||
print(new MiniJson().read_digits_from(json, p + k.length()))
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user