broccoli-pegjs-import

PEG.js filter for Broccoli

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
broccoli-pegjs-import
0.0.29 years ago9 years agoMinified + gzip package size for broccoli-pegjs-import in KB

Readme

broccoli-pegjs
Forked from broccoli-pegjs.
A PEG.js filter for Broccoli that uses pegjs-import.

Installation

npm install --save-dev broccoli-pegjs-import

Usage

var peg = require('pegjs-import');
var pegBuilder = require('broccoli-pegjs-import');
tree = pegBuilder(tree, {
  peg: peg
});

Options

  • wrapper - Wrap the generated parser in any code you want:

tree = pegBuilder(tree, {
  wrapper: function (src, parser) {
    return 'var Parser = ' + parser + ";\nvar parse = Parser.parse, SyntaxError = Parser.SyntaxError;\nexport {SyntaxError, parse};\nexport default parse;";
  }
});

  • peg - Provide an alternative peg instance.

tree = pegBuilder(tree, {
  peg: require('pegjs-import')
});