From 4c59bbfef9e556c7a5d6b4319eb2f2d27a607ccc Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 24 Jan 2011 13:55:14 +0100 Subject: [PATCH] Fixes to previous commit Require PEG only in the "parser" task -- it may not exist when executing the "build" task. Also don't make the "build" task dependent on the "parser" to break a dependency circle. --- Jakefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jakefile b/Jakefile index ea3205e..49ab00e 100644 --- a/Jakefile +++ b/Jakefile @@ -16,8 +16,6 @@ var PARSER_OUT_FILE = SRC_DIR + "/parser.js"; var PEGJS_VERSION = fs.readFileSync("VERSION", "utf8").trim(); -var PEG = require(PEGJS_OUT_FILE); - function exitFailure() { process.exit(1); } @@ -29,6 +27,7 @@ function abort(message) { desc("Generate the grammar parser"); task("parser", [], function() { + var PEG = require(PEGJS_OUT_FILE); var input = fs.readFileSync(PARSER_SRC_FILE, "utf8"); try { @@ -45,7 +44,7 @@ task("parser", [], function() { }); desc("Build the peg.js file"); -task("build", ["parser"], function() { +task("build", [], function() { function preprocess(file) { var input = fs.readFileSync(file, "utf8").trim(); return input.split("\n").map(function(line) {