1 | var gulp = require('gulp');
|
2 | var run = require('./');
|
3 |
|
4 |
|
5 | gulp.task('build-parser', function (done) {
|
6 | run('canopy lib/command-parser.peg').exec(true)
|
7 | .pipe(call(done))
|
8 | });
|
9 |
|
10 |
|
11 | gulp.task('default', ['build-parser']);
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | var Stream = require('stream');
|
17 |
|
18 |
|
19 | var call = function (callback1) {
|
20 | var stream = new Stream.Transform({objectMode:true});
|
21 | stream._transform = function (file, enc, callback2) {
|
22 | this.push(file);
|
23 | process.nextTick(callback2);
|
24 | process.nextTick(callback1);
|
25 | }
|
26 | return stream;
|
27 | }
|