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

Method make_root_node

code2flow/python.py:219–232  ·  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

217
218 @staticmethod
219 def make_root_node(lines, parent):
220 """
221 The "root_node" is an implict node of lines which are executed in the global
222 scope on the file itself and not otherwise part of any function.
223
224 :param lines list[ast]:
225 :param parent Group:
226 :rtype: Node
227 """
228 token = "(global)"
229 line_number = 0
230 calls = make_calls(lines)
231 variables = make_local_variables(lines, parent)
232 return Node(token, calls, variables, line_number=line_number, parent=parent)
233
234 @staticmethod
235 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