3 ms·
I agree. It's not as hard as one might think. I implemented my own handwritten JS parser using TDOP: https://github.com/higgsjs/Higgs/blob/master/source/parser/
by tachyonbeam 12y ago
I agree. It's not as hard as one might think. I implemented my own handwritten JS parser using TDOP:
https://github.com/higgsjs/Higgs/blob/master/source/parser/parser.d#L689 https://github.com/higgsjs/Higgs/blob/master/source/parser/p...
I think it's more flexible and maintainable this way. I didn't have to wrestle with odd grammar rules. Implementing the JS "automatic semicolon insertion" with parser generator tools seems like it would have been a cluster headache.
- thomasfoster96 12y agoI have to admit I also wrote my own parser because I was keen on implementing some pretty advanced macros in it (which I've almost done already). A lot of those parser generator tools assume you have a nice C-like language syntax.