0.4.0 • Published 9 years ago

siscom v0.4.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

siscom.js

it's a parser library for JS.

install

$ npm install --save siscom

example

var
siscom = require('siscom'),
P = siscom.Parsers,
C = siscom.Combinators;

var
x = C.some(P.string('x')),
y = P.string('y'),
z = C.some(P.string('z'));

var
parser = C.times(2, C.sequence(C.choice(x, z), y));

console.log(siscom.parseString(parser, "xxyzzy"));
// => [[['x', 'x'], 'y'], [['z', 'z'], 'y']]

feature

  • A parser object is usual JavaScript function.
  • A parsing error is usual JavaScript error, and it is very useful, for it has many informations for debugging.
    for example:

    <string>:1: expected "y"
    xxyzz
         ^
  • API looks like parsers library of Haskell.

license

See http://makenowjust.github.io/license/mit?2015.

contribute

If you find a bug or make it better, please send a issue or pull request :smile:

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago