From 88eb8c969f6abe119994c7ab307b9be58ff076a5 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 21 Jul 2025 14:26:06 +0200 Subject: feat: JSON object parsing --- json.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'json.h') diff --git a/json.h b/json.h index 44b064e..5f2f4c0 100644 --- a/json.h +++ b/json.h @@ -4,11 +4,18 @@ #include "string.h" #include "vec.h" +typedef struct { + Vec keys; // Vec + Vec values; // Vec + ptrdiff_t len; +} JSONObject; typedef struct { int *integer; - Vec *array; + Vec *array; // Vec Str *string; + JSONObject *object; } JSON; +JSON* JSONObject_get(JSONObject *obj, Str key); JSON JSON_parse(Arena *a, char *src); JSON JSON_Int(Arena *a, int val); #endif -- cgit v1.3