Skip to content
Snippets Groups Projects
  • Davis Silverman's avatar
    b0c5a938
    Use Peggy instead of deprecated Peg.js (#934) · b0c5a938
    Davis Silverman authored
    Hi there, `Peg.js` is unmaintained, so I figure you all would appreciate
    if I replaced it with the drop-in replacement of Peggy. This is work I
    am breaking out of #918.
    
    Peggy adds new features like source map support that we could use,
    although I do not include that in this change-set. It may be useful for
    debugging changes to the .pegjs file we have.e
    Use Peggy instead of deprecated Peg.js (#934)
    Davis Silverman authored
    Hi there, `Peg.js` is unmaintained, so I figure you all would appreciate
    if I replaced it with the drop-in replacement of Peggy. This is work I
    am breaking out of #918.
    
    Peggy adds new features like source map support that we could use,
    although I do not include that in this change-set. It may be useful for
    debugging changes to the .pegjs file we have.e
peg-loader.js 305 B
// webpack loader for .pegjs files using Peggy.

const peg = require('peggy');

module.exports = function loadPeg(source) {
  // TODO: a second value can be returned. A JS SourceMap object.
  //       Peggy can output such an object.
  return peg.generate(source, { output: 'source', format: 'umd' });
};