1 9 10 package org.jruby.compiler; 11 12 import org.jruby.ast.AndNode; 13 import org.jruby.ast.Node; 14 15 19 public class AndNodeCompiler implements NodeCompiler { 20 21 22 public AndNodeCompiler() { 23 } 24 25 public void compile(Node node, Compiler context) { 26 context.lineNumber(node.getPosition()); 27 28 final AndNode andNode = (AndNode)node; 29 30 NodeCompilerFactory.getCompiler(andNode.getFirstNode()).compile(andNode.getFirstNode(), context); 31 32 BranchCallback longCallback = new BranchCallback() { 33 public void branch(Compiler context) { 34 NodeCompilerFactory.getCompiler(andNode.getSecondNode()).compile(andNode.getSecondNode(), context); 35 } 36 }; 37 38 context.performLogicalAnd(longCallback); 39 } 40 } 41 | Popular Tags |