Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
craigulliott committed Nov 7, 2016
1 parent 0353c94 commit 268a14d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var pegjs = require('pegjs');
// Consts
const PLUGIN_NAME = 'gulp-codeverse-pegjs';

module.exports = function (fileName) {
module.exports = function (fileName, printGrammar) {
var grammarSource = [];
var headerSource;
var combinedFile;
Expand Down Expand Up @@ -71,7 +71,11 @@ module.exports = function (fileName) {

// add the javascript header to the front of the file;
combinedSource = headerSource + '\n' + combinedSource;


if (printGrammar) {
console.log('\n\n Combined Grammar:\n' + combinedSource + '\n\n');
}

// create the peg parser
let compiledParserSource = pegjs.generate(combinedSource, {
allowedStartRules: allRuleNames,
Expand Down

0 comments on commit 268a14d

Please sign in to comment.