3 category: JavaScript libraries
7 const P = require('parsimmon')
11 //=> { status: true, value: ['hello'] }
19 P.oneOf('abc') // like P.regexp(/[abc]/)
29 P.seq(a, b, c) // sequence of these
30 P.alt(a, b) // any of these
31 P.sepBy(a, P.string(',')) // sequence of `a`, separated by ','
32 P.sepBy1(a, P.string(',')) // same, at least once
34 a.or(b) // like P.alt(a, b)
35 a.skip(b) // parses `b` but discards it
39 a.times(1, 4) // 1 <= x <= 4
47 P.seq(P.number, P.oneOf('+-*/'), P.number)
48 .map(([left, oper, right]) => ({ oper, left, right }))
53 - <https://github.com/jneen/parsimmon/blob/master/API.md>