Skip to content
instance method

Prism::Node#breadth_first_search

breadth_first_search() { |node| ... }

Returns the first node that matches the given block when visited in a depth-first search. This is useful for finding a node that matches a particular condition.

Example
node.breadth_first_search { |node| node.node_id == node_id }