The main points of interest here is the allocator wrapper, which was kind of annoying to implement. Since the Zig allocator interface expects to know the size of all allocations, we have to secretly allocate space for that in front of the pointer that we return. This ends up causing a little bit of slightly nasty pointer manipulation. I took longer to debug this than I would like to admit from a bug that ended up being caused by storing a pointer to a stack copy of an Allocator object. Whoops. The other interesting thing I think (though much simpler) is representing the options bitfield as a packed struct. I think this makes initializing the parser options a lot nicer than the c variant.
The file is empty.
Description
Languages
Zig
97.1%
C
2.9%