MCPcopy Index your code
hub / github.com/nodejs/node / iter_child_nodes

Method iter_child_nodes

tools/inspector_protocol/jinja2/nodes.py:164–175  ·  view source on GitHub ↗

Iterates over all direct child nodes of the node. This iterates over all fields and yields the values of they are nodes. If the value of a field is a list all the nodes in that list are returned.

(self, exclude=None, only=None)

Source from the content-addressed store, hash-verified

162 pass
163
164 def iter_child_nodes(self, exclude=None, only=None):
165 """Iterates over all direct child nodes of the node. This iterates
166 over all fields and yields the values of they are nodes. If the value
167 of a field is a list all the nodes in that list are returned.
168 """
169 for field, item in self.iter_fields(exclude, only):
170 if isinstance(item, list):
171 for n in item:
172 if isinstance(n, Node):
173 yield n
174 elif isinstance(item, Node):
175 yield item
176
177 def find(self, node_type):
178 """Find the first node of a given type. If no such node exists the

Callers 8

find_allMethod · 0.95
visit_ForMethod · 0.45
generic_visitMethod · 0.45
_simple_visitMethod · 0.45
visit_CallBlockMethod · 0.45
set_ctxMethod · 0.45
set_linenoMethod · 0.45
set_environmentMethod · 0.45

Calls 1

iter_fieldsMethod · 0.95

Tested by

no test coverage detected