Formatting

redux
David Majda 10 years ago
parent f03ba4bf4f
commit 85c8f386c1

@ -205,7 +205,7 @@ function generateBytecode(ast) {
}
function buildCall(functionIndex, delta, env, sp) {
var params = arrays.map( objects.values(env), function(p) { return sp - p; });
var params = arrays.map(objects.values(env), function(p) { return sp - p; });
return [op.CALL, functionIndex, delta, params.length].concat(params);
}

@ -19,17 +19,14 @@ function generateJavascript(ast, options) {
'],',
'',
'peg$bytecode = [',
indent2(arrays.map(
ast.rules,
function(rule) {
return 'peg$decode("'
+ js.stringEscape(arrays.map(
rule.bytecode,
function(b) { return String.fromCharCode(b + 32); }
).join(''))
+ '")';
}
).join(',\n')),
indent2(arrays.map(ast.rules, function(rule) {
return 'peg$decode("'
+ js.stringEscape(arrays.map(
rule.bytecode,
function(b) { return String.fromCharCode(b + 32); }
).join(''))
+ '")';
}).join(',\n')),
'],'
].join('\n');
} else {

@ -18,9 +18,7 @@ function removeProxyRules(ast, options) {
function replaceInSubnodes(propertyName) {
return function(node, from, to) {
arrays.each(node[propertyName], function(subnode) {
replace(subnode, from, to);
});
arrays.each(node[propertyName], function(n) { replace(n, from, to); });
};
}
@ -69,9 +67,7 @@ function removeProxyRules(ast, options) {
indices.reverse();
arrays.each(indices, function(index) {
ast.rules.splice(index, 1);
});
arrays.each(indices, function(i) { ast.rules.splice(i, 1); });
}
module.exports = removeProxyRules;

@ -13,9 +13,7 @@ function reportLeftRecursion(ast) {
function checkSubnodes(propertyName) {
return function(node, appliedRules) {
arrays.each(node[propertyName], function(subnode) {
check(subnode, appliedRules);
});
arrays.each(node[propertyName], function(n) { check(n, appliedRules); });
};
}

Loading…
Cancel
Save