a very silly json parser in C
  • C 96.8%
  • CMake 3.2%
Find a file
2026-06-08 01:01:32 +09:30
.gitignore Add source 2026-06-05 05:37:17 +09:30
CMakeLists.txt Fix memory bug in _jerma_decode_array 2026-06-06 01:31:54 +09:30
jerma.h Add interface header guards 2026-06-08 01:01:32 +09:30
LICENSE Add source 2026-06-05 05:37:17 +09:30
README.md Add source 2026-06-05 05:37:17 +09:30
tests.c Add unicode code point parsing 2026-06-07 02:34:37 +09:30

jerma

a json parser in C, with some goofy behaviours.

examples

jerma reluctantly accepts valid RFC 7159 json structures, except for unicode escape sequences and exponential numbers, coz I couldn't be bothered

{"test": [1,2,3]}
null
[{}, 3.14, {"test": "4"}]

it may or may not treat commas as whitespace, and any whitespace as a valid delimiter between objects...

["a string" "...another string?", "hang on, I think you forgot something..."]

...and if it's unambiguous, it doesn't really need a delimiter at all:

["no...""this""can't""be"true"!"]
["I suppose you could find some n"0"vel uses for this though"]

alternatively, why not have all the delimiters? commas are just whitespace after all:

[4
,


,,,

,,,,,   null, ,]

(this is treated as [4,null])

jerma is a header-only stb-style library. it uses clash for maps internally, so you have to include an implementation of that with #define CLASH_IMPLEMENTATION in one file. you have to #define JERMA_IMPLEMENTATION too of course.