result = functionNode;
}
private RFunction getEnclosingFunction(ASTNode node) {
// find lexically enclosing function if exists
Function enfunc = findParent(node, Function.class);
if (enfunc == null) { return rootEnclosingFunction; }
RFunction rfunc = enfunc.getRFunction();
Utils.check(rfunc != null, "RFunction is not yet ready - note lazy build is necessary for functions");
return rfunc;
}