Parsing Expression Grammar (PEG)
PEG is a way to describe formal languages. PEG is suited to designing computer languages that do not have ambiguities. PEG.js is a Javascript parser generator using PEG.
I remember reading about it of a few weeks ago (in dailyjs) and wanted to try it out. Knowing how to design languages is a cool skill to have. I don’t mean cool in just an academic way. Being able to write a domain specific languages (DSL) can really make using some systems intuitive (e.g. testing).
I have tried to do something like this in my cmap github project. Given this was one of my first tries to write a parser, I felt my parser was error prone, and extending it would have been hard. There had to be a better way. And I think PEG.js is one of those better ways. I am going to try it out and learn how to use it. And I will hopefully have something to share. If anyone else is interested in this, definitely check it out: PEG.js.