1.0.1 • Published 4 years ago
paco-js v1.0.1
paco-js
Parser combinators for the browser
File parsers.js contains an implementation of chainable parser combinators, featuring both applicative and monadic interfaces.
The complete parsers namespace is:
{
  parser,
  charParser,
  digitParser,
  predicateBasedParser,
  pchar,
  pdigit,
  andThen,
  andThenBind,
  orElse,
  fail,
  succeed,
  choice,
  anyOf,
  lowercaseP,
  uppercaseP,
  letterP,
  digitP,
  whiteP,
  fmap,
  returnP,
  applyPx,
  applyP,
  lift2,
  sequenceP,
  sequenceP2,
  pstring,
  stringP,
  zeroOrMore,
  many,
  manyChars,
  many1,
  manyChars1,
  opt,
  optBook,
  discardSecond,
  discardFirst,
  sepBy1Book,
  sepBy1,
  between,
  betweenParens,
  bindP,
  tapP,
  logP,
  pword,
  trimP,
 }how to use
- import parsers from 'paco-js';
 
Test page is here.
Live examples page is here. Open devtools to see how the code works.
NB - with a big credit due to Understanding Parser Combinators and to Paco.