Refactor "rule_ref" emitter function a bit

redux
David Majda 13 years ago
parent eaba6b8a9d
commit 50a0371e2d

@ -859,10 +859,10 @@ PEG.compiler.emitter = function(ast) {
rule_ref: function(node, context) {
return formatCode(
'#{resultVar} = #{ruleMethod}();',
'#{resultVar} = parse_#{node.name}();',
{
ruleMethod: 'parse_' + node.name,
resultVar: resultVar(context.resultIndex)
node: node,
resultVar: resultVar(context.resultIndex)
}
);
},

Loading…
Cancel
Save