Plugin API: Implement the |plugins| option for |PEG.buildParser|
The |plugins| option allows users to use plugins that change how PEG.js operates. A plugin is any JavaScript object with a |use| method. After the user calls |PEG.buildParser|, this method is called for each plugin with the following two parameters: * PEG.js config that describes used grammar parser and compiler passes used to generate the parser * options passed by user to |PEG.buildParser| The plugin is expected to change the config as needed, possibly based on the options passed by user. It can e.g. change the used grammar parser, change the compiler passes (including adding its own), etc. This way it can extend PEG.js in a flexible way. Implements part of GH-106.redux
parent
d02098eebe
commit
76f5c88073
Loading…
Reference in New Issue