Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

susisu/Loquat-legacy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loquat

JavaScript monadic parser combinators inspired by Haskell's Parsec.

Installation and Usage

Node.js

$ npm install loquat

Here is a simple parsing example:

var lq = require("loquat");
var result = lq.parse(lq.string("foo"), "name", "foobar", 8);
if (result.succeeded) {
    console.log(result.value);
}
else {
    console.log(result.error.toString());
}

Browsers

$ bower install susisu/Loquat
<script type="text/javascript" src="./bower_components/loquat/dist/loquat.min.js"></script>
<script type="text/javascript">
var result = loquat.parse(loquat.string("foo"), "name", "foobar", 8);
if (result.succeeded) {
    console.log(result.value);
}
else {
    console.log(result.error.toString());
}
</script>

License

MIT License