Commit 9dd403dca33e662b067d0fa72d48e45eb8ee5aae

Thomas de Grivel 2024-08-14T22:28:58

wip json_buf_parse

diff --git a/json/json.c b/json/json.c
index 26c35ae..a67aa6a 100644
--- a/json/json.c
+++ b/json/json.c
@@ -291,6 +291,9 @@ s_tag * json_buf_parse (s_buf *buf, s_tag *dest)
     case 'f':
       return json_buf_parse_bool(buf, dest);
       break;
+    case 'n':
+      return json_buf_parse_null(buf, dest);
+      break;
     default:
       return NULL;
   }
diff --git a/test/json/basics.kc3 b/test/json/basics.kc3
index b51c168..c41f47e 100644
--- a/test/json/basics.kc3
+++ b/test/json/basics.kc3
@@ -4,3 +4,9 @@ quote JSON.from_str("""{"a": "b"}""")
 JSON.from_str("""{"a": "b"}""")
 quote JSON.from_str("""{"a": 1}""")
 JSON.from_str("""{"a": 1}""")
+quote JSON.from_str("""{"a": true}""")
+JSON.from_str("""{"a": true}""")
+quote JSON.from_str("""{"a": false}""")
+JSON.from_str("""{"a": false}""")
+quote JSON.from_str("""{"a": null}""")
+JSON.from_str("""{"a": null}""")
diff --git a/test/json/basics.out.expected b/test/json/basics.out.expected
index 4135c76..14173d4 100644
--- a/test/json/basics.out.expected
+++ b/test/json/basics.out.expected
@@ -4,3 +4,9 @@ JSON.from_str("{\"a\": \"b\"}")
 %{"a" => "b"}
 JSON.from_str("{\"a\": 1}")
 %{"a" => 1}
+JSON.from_str("{\"a\": true}")
+%{"a" => true}
+JSON.from_str("{\"a\": false}")
+%{"a" => false}
+JSON.from_str("{\"a\": null}")
+%{"a" => void}