Files
actual/packages/loot-core/peg-loader.js
Davis Silverman b0c5a9389c Use Peggy instead of deprecated Peg.js (#934)
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
2023-04-22 20:16:07 -04:00

10 lines
305 B
JavaScript

// 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' });
};