paco-js

1.0.1 • Public • Published

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.

This project is being maintained during Open Source Saturday

Readme

Keywords

Package Sidebar

Install

npm i paco-js

Weekly Downloads

1

Version

1.0.1

License

GPL-3.0

Unpacked Size

78.4 kB

Total Files

9

Last publish

Collaborators

  • muzietto