#pragma once #include "../include/memory.h" #include "../include/str.h" #include "../include/vec.h" typedef struct { Vec keys; // Vec Vec values; // Vec size len; } JSONObject; typedef enum { JSON_NULL, JSON_BOOL, JSON_INTEGER, JSON_FLOAT, JSON_STRING, JSON_ARRAY, JSON_OBJECT } JSONType; typedef struct { JSONType type; union { bool boolean; i32 integer; f32 floating; Vec array; // Vec Str string; JSONObject object; } as; } JSON; JSON *JSONObject_get(JSONObject obj, Str key); i32 JSON_fprint(FILE *w, JSON json); JSON JSON_parse(Arena *a, byte *src); JSON JSON_Int(Arena *a, i32 val);