|
|
@ -29,12 +29,15 @@ const peg = {
|
|
|
|
|
|
|
|
|
|
|
|
options = typeof options !== "undefined" ? options : {};
|
|
|
|
options = typeof options !== "undefined" ? options : {};
|
|
|
|
|
|
|
|
|
|
|
|
const plugins = "plugins" in options ? options.plugins : [];
|
|
|
|
|
|
|
|
const session = new compiler.Session( {
|
|
|
|
const session = new compiler.Session( {
|
|
|
|
passes: util.convertPasses( compiler.passes )
|
|
|
|
passes: util.convertPasses( compiler.passes )
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
|
|
plugins.forEach( p => {
|
|
|
|
if ( Array.isArray( options.plugins ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options.plugins.forEach( p => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( typeof p.use !== "function" ) return;
|
|
|
|
|
|
|
|
|
|
|
|
p.use( session, options );
|
|
|
|
p.use( session, options );
|
|
|
|
|
|
|
|
|
|
|
|