@markw65/peggy-optimizer
v1.0.1
Published
Peggy plugin to produce optimized js
Downloads
6
Readme
Peggy Optimizer Plugin
This package provides a peggy plugin that produces an optimized parser that will typically outperform a parser generated by peggy alone.
Installation
npm install @markw65/peggy-optimizer
Command line usage
Just add --plugin @markw65/peggy-optimizer
to your normal peggy command line
npx peggy --plugin @markw65/peggy-optimizer [other options...] grammar.peggy
Peggy API
const peggyOptimizer = require("@markw65/peggy-optimizer");
const peggy = require("peggy");
...
const parser = peggy.generate(source, {
grammarSource: "grammar.peggy",
plugins: [peggyOptimizer],
...otherOptions
});