function findParent(node, predicate) {
      let n = node;
      while (n) {
        if (predicate(n)) {
          return n;
        }
        n = n.parent;
      }
      return undefined;
    }
Find a parent that satisfy the given predicate
@param {ASTNode} node
@param {(node: ASTNode) => boolean} predicate
@returns {ASTNode | undefined}