aboutsummaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-22 09:39:13 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-22 09:39:13 +0200
commit757fa44326ea8a6ba7b8416996d9b4fbee2fca97 (patch)
tree08a56c3090031cc211e6309ed376a2d6e0afdd1d /json.c
parent95018d0e410c22fc56a6518d967be25428e3a6ed (diff)
feat(json): null parsing
Diffstat (limited to 'json.c')
-rw-r--r--json.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/json.c b/json.c
index 736dd34..dc1ac67 100644
--- a/json.c
+++ b/json.c
@@ -213,6 +213,11 @@ parse_any_result parse_any(Arena *a, byte *src, uptr start_pos) {
result.value->boolean = new(a, i32, 1);
*result.value->boolean = 0;
result.pos = start_pos + 5;
+ } else if (memcmp(src + result.pos, "null", 4) == 0) {
+ result.value->null = new(a, i32, 1);
+ result.pos = start_pos + 4;
+ } else {
+ assert(false);
}
return result;