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

Method make_root_node

code2flow/php.py:337–352  ·  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

335
336 @staticmethod
337 def make_root_node(lines, parent):
338 """
339 The "root_node" is an implict node of lines which are executed in the global
340 scope on the file itself and not otherwise part of any function.
341
342 :param lines list[ast]:
343 :param parent Group:
344 :rtype: Node
345 """
346 token = "(global)"
347 line_number = lineno(lines[0]) if lines else 0
348 calls = make_calls(lines)
349 variables = make_local_variables(lines, parent)
350 root_node = Node(token, calls, variables, parent,
351 line_number=line_number)
352 return root_node
353
354 @staticmethod
355 def make_class_group(tree, parent):

Callers 2

make_class_groupMethod · 0.45
make_file_groupFunction · 0.45

Calls 4

NodeClass · 0.85
linenoFunction · 0.70
make_callsFunction · 0.70
make_local_variablesFunction · 0.70

Tested by

no test coverage detected