implement JStest;
include "sys.m";
sys: Sys;
include "draw.m";
include "json.m";
json: JSON;
include "bufio.m";
bufio: Bufio;
JStest: module {
init: fn(ctx: ref Draw->Context, argv: list of string);
};
init(nil: ref Draw->Context, nil: list of string){
sys = load Sys Sys->PATH;
json = load JSON JSON->PATH;
bufio = load Bufio Bufio->PATH;
JValue: import json;
buffd := bufio->open("3.json", Sys->OREAD);
json->init(bufio);
(jval, err) := json->readjson(buffd);
if(jval == nil) { sys->print("err: %s|%r\n", err); exit; }
sys->print("isarray flag: %d\n", jval.get("response").isarray());
# keys := array[] of {"uid", "first_name", "last_name", "nickname"};
cnt := 0;
while(cnt != 3){
child := jval.get("response");
if(child == nil) { sys->print("child break\n"); exit;}
sys->print("jval --%d --%s\n\n", cnt, jval.get("uid").text());
}
}