Method: Jinx::Visitor#visit_root

Defined in:
lib/jinx/helpers/visitor.rb

#visit_root(node, &operator) ⇒ Object (private)

Visits the root node and all descendants.



216
217
218
219
220
221
222
223
224
225
# File 'lib/jinx/helpers/visitor.rb', line 216

def visit_root(node, &operator)
  clear
  # Exclude cycles if the prune cycles flag is set. 
  @exclude.merge!(cyclic_nodes(node)) if @prune_cycle_flag 
  # Visit the root node.
  result = visit_recursive(node, &operator)
  # Reset the exclusions if the prune cycles flag is set.
  @exclude.clear if @prune_cycle_flag 
  result
end