class RSpec::Support::Source::Node

def each

We use a loop here (instead of recursion) to prevent SystemStackError
def each
  return to_enum(__method__) unless block_given?
  node_queue = []
  node_queue << self
  while (current_node = node_queue.shift)
    yield current_node
    node_queue.concat(current_node.children)
  end
end