From 3b3798fa39ef3fa880d275fce306c9575d8c2e1a Mon Sep 17 00:00:00 2001 From: David Majda Date: Sun, 6 Jan 2013 20:27:35 +0100 Subject: [PATCH] Merge lib/compiler/passes.js into lib/compiler.js It didn't make sense to have the passes in a separate file. --- Makefile | 1 - lib/compiler.js | 15 ++++++++++++++- lib/compiler/passes.js | 14 -------------- package.json | 1 - 4 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 lib/compiler/passes.js diff --git a/Makefile b/Makefile index d99a681..2d4e65b 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ MODULES = utils \ compiler/passes/remove-proxy-rules \ compiler/passes/report-left-recursion \ compiler/passes/report-missing-rules \ - compiler/passes \ compiler \ peg diff --git a/lib/compiler.js b/lib/compiler.js index fd9f27a..b116e78 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -1,7 +1,20 @@ var utils = require("./utils"); module.exports = { - passes: require("./compiler/passes"), + /* + * Compiler passes. + * + * Each pass is a function that is passed the AST. It can perform checks on it + * or modify it as needed. If the pass encounters a semantic error, it throws + * |PEG.GrammarError|. + */ + passes: { + reportMissingRules: require("./compiler/passes/report-missing-rules"), + reportLeftRecursion: require("./compiler/passes/report-left-recursion"), + removeProxyRules: require("./compiler/passes/remove-proxy-rules"), + generateBytecode: require("./compiler/passes/generate-bytecode"), + generateJavascript: require("./compiler/passes/generate-javascript") + }, /* * Names of passes that will get run during the compilation (in the specified diff --git a/lib/compiler/passes.js b/lib/compiler/passes.js deleted file mode 100644 index bf3a0bf..0000000 --- a/lib/compiler/passes.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Compiler passes. - * - * Each pass is a function that is passed the AST. It can perform checks on it - * or modify it as needed. If the pass encounters a semantic error, it throws - * |PEG.GrammarError|. - */ -module.exports = { - reportMissingRules: require("./passes/report-missing-rules"), - reportLeftRecursion: require("./passes/report-left-recursion"), - removeProxyRules: require("./passes/remove-proxy-rules"), - generateBytecode: require("./passes/generate-bytecode"), - generateJavascript: require("./passes/generate-javascript") -}; diff --git a/package.json b/package.json index bdd7a42..437376f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "examples/json.pegjs", "lib/compiler.js", "lib/compiler/opcodes.js", - "lib/compiler/passes.js", "lib/compiler/passes/generate-bytecode.js", "lib/compiler/passes/generate-javascript.js", "lib/compiler/passes/remove-proxy-rules.js",