siscom
v0.4.0
Published
it's a parser library for JS.
Downloads
4
Readme
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: