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

Function children

code2flow/javascript.py:203–216  ·  view source on GitHub ↗

The acorn AST is tricky. This returns all the children of an element :param ast tree: :rtype: list[ast]

(tree)

Source from the content-addressed store, hash-verified

201
202
203def children(tree):
204 """
205 The acorn AST is tricky. This returns all the children of an element
206 :param ast tree:
207 :rtype: list[ast]
208 """
209 assert type(tree) == dict
210 ret = []
211 for k, v in tree.items():
212 if type(v) == dict and v.get('type'):
213 ret.append(v)
214 if type(v) == list:
215 ret += filter(None, v)
216 return ret
217
218
219def get_inherits(tree):

Callers 1

separate_namespacesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected