Skip to content

Commit

Permalink
Corrections to example code
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Oct 18, 2015
1 parent 3cd8508 commit 26a544a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ npm install --save voltrevo-parser
```js
'use strict';

var parser = require('parser');
var parser = require('voltrevo-parser');

var foo = parser.string('foo');
var bar = parser.string('bar');
Expand All @@ -26,9 +26,16 @@ var demo = parser.sequence(
baz
);

var stream = parser.stream('foobarbarbarbaz');
var stream = parser.Stream('foobarbarbarbaz');

console.log(demo(stream));
console.log(demo.consume(stream)); /*
{ name: 'sequence(oneOrMore("foo"), many("bar"), "baz")',
value: [ [ 'foo' ], [ 'bar', 'bar', 'bar' ], 'baz' ],
accepted: true,
valid: true,
invalidations: [],
location: [ [Function], [Function] ] }
*/
```

## License
Expand Down

0 comments on commit 26a544a

Please sign in to comment.