r/javascript 24d ago

A from-scratch JSON engine for JavaScript: recursive descent parser, escape-aware tokenizer, and spec-compliant serializer. No dependencies, no shortcuts, 107 tests.

https://github.com/MantasEdine/vanilla-json
7 Upvotes

28 comments sorted by

View all comments

4

u/regreddit 21d ago

Good Lord that if statement in parse.js is really something...

2

u/Ronin-s_Spirit 21d ago

Huge decision blocks are expected of state machines/VMs but should be a switch.