Node nextNode = rootNode.getBodyNode();
if (nextNode != null) {
if (nextNode.getNodeType() == NodeType.BLOCKNODE) {
// it's a multiple-statement body, iterate over all elements in turn and chain if it get too long
BlockNode blockNode = (BlockNode) nextNode;
for (int i = 0; i < blockNode.size(); i++) {
if ((i + 1) % RubyInstanceConfig.CHAINED_COMPILE_LINE_COUNT == 0) {
methodCompiler = methodCompiler.chainToMethod("__file__from_line_" + (i + 1));
}
compile(blockNode.get(i), methodCompiler, i + 1 >= blockNode.size());
}
} else {
// single-statement body, just compile it
compile(nextNode, methodCompiler,true);
}