146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
# File 'lib/archspec/analyzer.rb', line 146
def visit(graph, path, node, current_constant: nil, namespace: [], nesting: [], visibility: :public,
default_scope: :instance)
return unless node
case node
when Prism::ProgramNode, Prism::StatementsNode
visit_children(graph, path, node, current_constant: current_constant, namespace: namespace, nesting: nesting,
visibility: visibility, default_scope: default_scope)
when Prism::ClassNode
visit_class(graph, path, node, current_constant: current_constant, namespace: namespace, nesting: nesting)
when Prism::ModuleNode
visit_module(graph, path, node, current_constant: current_constant, namespace: namespace, nesting: nesting)
when Prism::SingletonClassNode
visit_singleton_class(graph, path, node, current_constant: current_constant, namespace: namespace,
nesting: nesting, visibility: visibility,
default_scope: default_scope)
when Prism::DefNode
visit_def(graph, path, node, current_constant: current_constant, namespace: namespace,
nesting: nesting, visibility: visibility, default_scope: default_scope)
when Prism::CallNode
visit_call(graph, path, node, current_constant: current_constant, namespace: namespace,
nesting: nesting, visibility: visibility, default_scope: default_scope)
when Prism::ConstantPathNode, Prism::ConstantReadNode
add_constant_reference(graph, path, node, current_constant, nesting)
else
visit_children(graph, path, node, current_constant: current_constant, namespace: namespace, nesting: nesting,
visibility: visibility, default_scope: default_scope)
end
end
|