MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / make_root_node

Method make_root_node

code2flow/ruby.py:285–298  ·  view source on GitHub ↗

The "root_node" is an implict node of lines which are executed in the global scope on the file itself and not otherwise part of any function. :param lines list[ast]: :param parent Group: :rtype: Node

(lines, parent)

Source from the content-addressed store, hash-verified

283
284 @staticmethod
285 def make_root_node(lines, parent):
286 """
287 The "root_node" is an implict node of lines which are executed in the global
288 scope on the file itself and not otherwise part of any function.
289
290 :param lines list[ast]:
291 :param parent Group:
292 :rtype: Node
293 """
294 token = "(global)"
295 calls = make_calls(lines)
296 variables = make_local_variables(lines, parent)
297 root_node = Node(token, calls, variables, parent=parent)
298 return root_node
299
300 @staticmethod
301 def make_class_group(tree, parent):

Callers

nothing calls this directly

Calls 3

NodeClass · 0.85
make_callsFunction · 0.70
make_local_variablesFunction · 0.70

Tested by

no test coverage detected