1.0.6 • Published 5 years ago

subparjs v1.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Subpar.js

A subpar parser combinator library for JavaScript

Usage

const {Parser,str}=require("subparjs");
let firstParser=Parser(str("Elephants"));
let debugThread=[];
let space=Parser(str(" "));
let be=Parser(str("are")).or(Parser(str("is")));
let opinion=space.then(be).then(space).then(Parser(str("great")).or(Parser(str("terrible")))).then(Parser(str("!")));
console.log(JSON.stringify(firstParser.then(opinion).parse("Elephants are great!",debugThread)));
console.log(JSON.stringify(debugThread));//Neatly formatted in postfix
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago