A simple parser generator inspired by Peg.js
$ npm install carpeg-cli
// myParser.cpeg
import WhiteSpace
import String
map|start = "~" _ items: Item*|"|" _ "~";
map|Item = _ value: ([0-9] / String)
{map|
export = $value;
};
$ carpeg generate myParser.cpeg myParser.js --target javascript
const myParser = require("myParser.js");
myParser.parse("~ 1|3|4|'Hello' ~") // Array(1, 3, 4, "hello")