Browse Source

Refactor "rule_ref" emitter function a bit

redux
David Majda 10 years ago
parent
commit
50a0371e2d
  1. 6
      src/emitter.js

6
src/emitter.js

@ -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