3 category: JavaScript libraries
9 const P = require('parsimmon')
13 //=> { status: true, value: ['hello'] }
21 P.oneOf('abc') // like P.regexp(/[abc]/)
31 P.seq(a, b, c) // sequence of these
32 P.alt(a, b) // any of these
33 P.sepBy(a, P.string(',')) // sequence of `a`, separated by ','
34 P.sepBy1(a, P.string(',')) // same, at least once
36 a.or(b) // like P.alt(a, b)
37 a.skip(b) // parses `b` but discards it
41 a.times(1, 4) // 1 <= x <= 4
49 P.seq(P.number, P.oneOf('+-*/'), P.number)
50 .map(([left, oper, right]) => ({ oper, left, right }))
55 - <https://github.com/jneen/parsimmon/blob/master/API.md>