const P = require("parsimmon");
const round = P.regexp(/[(].*?[)]/).node("round");
const square = P.regexp(/[\[].*?[\]]/).node("square");
const curly = P.regexp(/[{].*?[}]/).node("curly");
const other = P.any.node("other");
const lang = P.alt(round, square, curly, other)
.many()
.map((values) => {
// TODO: Merge all the "other" nodes together
return values;
});
lang.parse("(round) and [square] with {curly}, they all work");