find

fun Node.find(predicate: (Node) -> Boolean, walker: (Node) -> Sequence<Node> = Node::walk): Node?

Return

the first node in the AST for which the predicate is true. Null if none are found.

Parameters

walker

the function that generates the nodes to operate on in the desired sequence.