Replace |for| loop iterating over sequence elements with |each|

redux
David Majda 13 years ago
parent a19ea83ffa
commit 47969a2f61

@ -854,14 +854,12 @@ PEG.compiler.emitter = function(ast) {
formalParams = [];
actualParams = [];
var elements = node.expression.elements;
var elementsLength = elements.length;
for (var i = 0; i < elementsLength; i++) {
if (elements[i].type === "labeled") {
formalParams.push(elements[i].label);
each(node.expression.elements, function(element, i) {
if (element.type === "labeled") {
formalParams.push(element.label);
actualParams.push(resultVar(context.resultIndex) + '[' + i + ']');
}
}
});
} else if (node.expression.type === "labeled") {
formalParams = [node.expression.label];
actualParams = [resultVar(context.resultIndex)];

Loading…
Cancel
Save