Skip to content

Commit

Permalink
Add new visitor for Prism::ConstantPathNode
Browse files Browse the repository at this point in the history
  • Loading branch information
egiurleo committed May 13, 2024
1 parent b16c222 commit 9a27f3d
Show file tree
Hide file tree
Showing 3 changed files with 4,861 additions and 3,939 deletions.
6 changes: 6 additions & 0 deletions lib/spoom/deadcode/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ def visit_constant_read_node(node)
reference_constant(node.name.to_s, node)
end

sig { override.params(node: Prism::ConstantPathNode).void }
def visit_constant_path_node(node)
visit(node.parent) if node.parent
reference_constant(node.name.to_s, node)
end

sig { override.params(node: Prism::ConstantWriteNode).void }
def visit_constant_write_node(node)
name = node.name.to_s
Expand Down
5 changes: 0 additions & 5 deletions lib/spoom/deadcode/visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ def visit_constant_path_and_write_node(node)
visit_child_nodes(node)
end

sig { override.params(node: Prism::ConstantPathNode).void }
def visit_constant_path_node(node)
visit_child_nodes(node)
end

sig { override.params(node: Prism::ConstantPathOperatorWriteNode).void }
def visit_constant_path_operator_write_node(node)
visit_child_nodes(node)
Expand Down
Loading

0 comments on commit 9a27f3d

Please sign in to comment.