Browse Source

Refactor "semantic_and" emitter function a bit

redux
David Majda 10 years ago
parent
commit
13ae52b2bf
  1. 6
      src/emitter.js

6
src/emitter.js

@ -724,10 +724,10 @@ PEG.compiler.emitter = function(ast) {
semantic_and: function(node, context) {
return formatCode(
'#{resultVar} = (function() {#{actionCode}})() ? "" : null;',
'#{resultVar} = (function() {#{node.code}})() ? "" : null;',
{
actionCode: node.code,
resultVar: resultVar(context.resultIndex)
node: node,
resultVar: resultVar(context.resultIndex)
}
);
},

Loading…
Cancel
Save