1 28 29 package org.jruby.compiler; 30 31 import java.util.Iterator ; 32 import org.jruby.ast.BlockNode; 33 import org.jruby.ast.Node; 34 35 39 public class BlockNodeCompiler implements NodeCompiler { 40 41 42 public BlockNodeCompiler() { 43 } 44 45 public void compile(Node node, Compiler context) { 46 context.lineNumber(node.getPosition()); 47 48 BlockNode blockNode = (BlockNode)node; 49 50 for (Iterator iter = blockNode.childNodes().iterator(); iter.hasNext();) { 51 Node n = (Node)iter.next(); 52 53 NodeCompilerFactory.getCompiler(n).compile(n, context); 54 55 if (iter.hasNext()) { 56 context.consumeCurrentValue(); 58 } 59 } 60 } 61 62 } 63 | Popular Tags |