parsimmon/issues/316

node v10.24.1
version: 2.0.0
endpointsharetweet
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");
Loading…

no comments

    sign in to comment