Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

grunt-peg

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-peg - npm Package Compare versions

Comparing version
1.2.0
to
1.3.0
test/expected/angular_options

Sorry, the diff of this file is not supported yet

+5
-0

@@ -51,2 +51,7 @@ /*

options: { plugins: [ 'pegjs-coffee-plugin' ] }
},
angular_options: {
src: 'test/fixtures/a.peg',
dest: 'tmp/angular_options_standard',
angular: { module: 'pegjs', factory: 'exampleParser' }
}

@@ -53,0 +58,0 @@ },

+1
-1
{
"name": "grunt-peg",
"description": "A grunt multi task that generates parsers from PEG grammars.",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/dvberkel/grunt-peg",

@@ -6,0 +6,0 @@ "author": {

@@ -107,2 +107,23 @@ # grunt-peg

#### Wrap in an Angular Factory
It is also possible to wrap the generated parser in an Angular
factory.
```js
grunt.initConfig({
peg: {
options: { trackLineAndColumn: true },
example : {
src: "grammar/example.peg",
dest: "grammar/example.js",
angular: {
module: "pegjs",
factory: "exampleParser"
}
}
}
})
```
##### Note on plugins

@@ -150,2 +171,3 @@

* 2014-03-20 v1.3.0 Wrap in Angular Factory
* 2014-01-05 v1.2.0 Support plugins

@@ -162,5 +184,7 @@ * 2014-01-05 v1.1.0 Support PEG 0.8.0

* [mstefaniuk][]
* [bertrandgressier][]
[welwood08]: https://github.com/welwood08
[mstefaniuk]: https://github.com/mstefaniuk
[bertrandgressier]: https://github.com/bertrandgressier

@@ -167,0 +191,0 @@ [Grunt]: http://gruntjs.com/

@@ -66,4 +66,10 @@ /*

// Save the parser.
grunt.file.write(f.dest, options.exportVar + ' = ' + parser + ';');
if (f.angular != null){
var angularModule = "angular.module('"+ f.angular.module+"', []).factory('"+ f.angular.factory+"',function(){ return ";
grunt.file.write(f.dest, angularModule + parser + '});');
}else {
grunt.file.write(f.dest, options.exportVar + ' = ' + parser + ';');
}
grunt.log.writeln('Parser "' + f.dest + '" generated in ' + time + 'ms.');

@@ -70,0 +76,0 @@ });

@@ -61,3 +61,12 @@ 'use strict';

test.done();
},
angular_options: function(test) {
test.expect(1);
var actual = grunt.file.read('tmp/angular_options_standard');
var expected = grunt.file.read('test/expected/angular_options');
test.equal(actual, expected, 'Unexpected parser generated for angular_options_standard');
test.done();
}
};

Sorry, the diff of this file is not supported yet