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

Function children

code2flow/php.py:111–128  ·  view source on GitHub ↗

Given an ast tree get all children. For PHP, children are anything with a nodeType. :param tree_el ast: :rtype: list[ast]

(tree)

Source from the content-addressed store, hash-verified

109
110
111def children(tree):
112 """
113 Given an ast tree get all children. For PHP, children are anything
114 with a nodeType.
115
116 :param tree_el ast:
117 :rtype: list[ast]
118 """
119 assert isinstance(tree, dict)
120 ret = []
121 for v in tree.values():
122 if isinstance(v, list):
123 for el in v:
124 if isinstance(el, dict) and el.get('nodeType'):
125 ret.append(el)
126 elif isinstance(v, dict) and v.get('nodeType'):
127 ret.append(v)
128 return ret
129
130
131def make_calls(body_el):

Callers 1

separate_namespacesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected