Skip to content

Commit eaead1a

Browse files
authored
Merge pull request #33 from Morriar/at-visit-all
Introduce `visit_all`
2 parents 1a491fc + a33e675 commit eaead1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/syntax_tree/visitor.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ def visit(node)
5757
node&.accept(self)
5858
end
5959

60+
def visit_all(nodes)
61+
nodes.each { |node| visit(node) }
62+
end
63+
6064
def visit_child_nodes(node)
61-
node.child_nodes.each { |child_node| visit(child_node) }
65+
visit_all(node.child_nodes)
6266
end
6367

6468
# Visit an ARef node.

0 commit comments

Comments
 (0)