Allow the neighborhood to be the entire enclosing function

This commit is contained in:
Tiferet Gazit
2021-11-20 02:28:53 +00:00
committed by GitHub
parent 05460f6444
commit d52af5599a

View File

@@ -185,8 +185,7 @@ module NeighborhoodBodies {
*/
Raw::AstNode getNeighborhoodAstNode(Raw::AstNode node) {
if
// `node` will always have a parent as we start at and endpoint
node.getParentNode() = getOutermostEnclosingFunction(node) or
node = getOutermostEnclosingFunction(node) or
getNumDescendents(node.getParentNode()) > maxNumDescendants()
then result = node
else result = getNeighborhoodAstNode(node.getParentNode())