@ -1,5 +1,15 @@
"use strict" ;
let generateBytecode = require ( "./passes/generate-bytecode" ) ;
let generateJS = require ( "./passes/generate-js" ) ;
let removeProxyRules = require ( "./passes/remove-proxy-rules" ) ;
let reportDuplicateLabels = require ( "./passes/report-duplicate-labels" ) ;
let reportDuplicateRules = require ( "./passes/report-duplicate-rules" ) ;
let reportInfiniteRecursion = require ( "./passes/report-infinite-recursion" ) ;
let reportInfiniteRepetition = require ( "./passes/report-infinite-repetition" ) ;
let reportUndefinedRules = require ( "./passes/report-undefined-rules" ) ;
let visitor = require ( "./visitor" ) ;
function processOptions ( options , defaults ) {
let processedOptions = { } ;
@ -19,7 +29,7 @@ function processOptions(options, defaults) {
let compiler = {
// AST node visitor builder. Useful mainly for plugins which manipulate the
// AST.
visitor : require( "./ visitor") ,
visitor : visitor,
// Compiler passes.
//
@ -28,18 +38,18 @@ let compiler = {
// |peg.GrammarError|.
passes : {
check : {
reportUndefinedRules : re quire( "./passes/report-undefined-rules" ) ,
reportDuplicateRules : re quire( "./passes/report-duplicate-rules" ) ,
reportDuplicateLabels : re quire( "./passes/report-duplicate-labels" ) ,
reportInfiniteRecursion : re quire( "./passes/report-infinite-recursion" ) ,
reportInfiniteRepetition : re quire( "./passes/report-infinite-repetition" )
reportUndefinedRules : re portUndefinedRules ,
reportDuplicateRules : re portDuplicateRules ,
reportDuplicateLabels : re portDuplicateLabels ,
reportInfiniteRecursion : re portInfiniteRecursion ,
reportInfiniteRepetition : re portInfiniteRepetition
} ,
transform : {
removeProxyRules : re quire( "./passes/remove-proxy-rules" )
removeProxyRules : re moveProxyRules
} ,
generate : {
generateBytecode : require( "./passes/generate-bytecode" ) ,
generateJS : require( "./passes/generate-js" )
generateBytecode : generateBytecode ,
generateJS : generateJS
}
} ,