From 8f59e21c8dff392fa4597727a3d1d94c11899d6f Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 19 Apr 2010 20:45:27 +0200 Subject: [PATCH] Renamed an iterator variable: "key" -> "rule". --- lib/compiler.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index cf07c89..77c2050 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -25,14 +25,14 @@ PEG.buildParser = function(grammar, startRule) { var ast = PEG.grammarParser.parse(grammar); - for (var key in ast) { - ast[key].checkReferencedRulesExist(ast); + for (var rule in ast) { + ast[rule].checkReferencedRulesExist(ast); } if (ast[startRule] === undefined) { throw new PEG.Grammar.GrammarError("Missing \"" + startRule + "\" rule."); } - for (var key in ast) { - ast[key].checkNoLeftRecursion(ast, []); + for (var rule in ast) { + ast[rule].checkNoLeftRecursion(ast, []); } return PEG.Compiler.compileParser(ast, startRule); @@ -422,8 +422,8 @@ PEG.Compiler = { this._resetUniqueIdentifierCounters(); var parseFunctionDefinitions = []; - for (var key in grammar) { - parseFunctionDefinitions.push(grammar[key].compile()); + for (var rule in grammar) { + parseFunctionDefinitions.push(grammar[rule].compile()); } var source = this.formatCode(