164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
# File 'lib/archspec/analyzer.rb', line 164
def visit(graph, path, node, current_constant: nil, namespace: [])
return unless node
case node
when Prism::ProgramNode, Prism::StatementsNode
visit_children(graph, path, node, current_constant: current_constant, namespace: namespace)
when Prism::ClassNode
visit_class(graph, path, node, current_constant: current_constant, namespace: namespace)
when Prism::ModuleNode
visit_module(graph, path, node, current_constant: current_constant, namespace: namespace)
when Prism::DefNode
visit_def(graph, path, node, current_constant: current_constant, namespace: namespace)
when Prism::CallNode
visit_call(graph, path, node, current_constant: current_constant, namespace: namespace)
when Prism::ConstantPathNode, Prism::ConstantReadNode
add_constant_reference(graph, path, node, current_constant)
else
visit_children(graph, path, node, current_constant: current_constant, namespace: namespace)
end
end
|