Update the json API

This commit is contained in:
Christoffer Lerno
2023-08-19 00:53:28 +02:00
parent d5aebb434c
commit ed70f39da8
2 changed files with 85 additions and 82 deletions

View File

@@ -7,9 +7,7 @@ fn void! simple_test()
{
ByteReader reader;
reader.init(`{ "b": 123, "c": [ { "d": 66 }, null, "hello", false ] }`);
JsonParser json;
json.init(reader.as_stream());
Object* o = json.parse_any()!;
Object* o = json::parse(reader.as_stream())!;
assert(o.get_int("b")! == 123);
assert(o.get("c").get_at(0).get_int("d")! == 66);
assert(o.get("c").get_at(1).is_null()!);