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

Method set_ctx

tools/inspector_protocol/jinja2/nodes.py:194–206  ·  view source on GitHub ↗

Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context.

(self, ctx)

Source from the content-addressed store, hash-verified

192 yield result
193
194 def set_ctx(self, ctx):
195 """Reset the context of a node and all child nodes. Per default the
196 parser will all generate nodes that have a 'load' context as it's the
197 most common one. This method is used in the parser to set assignment
198 targets and other nodes to a store context.
199 """
200 todo = deque([self])
201 while todo:
202 node = todo.popleft()
203 if 'ctx' in node.fields:
204 node.ctx = ctx
205 todo.extend(node.iter_child_nodes())
206 return self
207
208 def set_lineno(self, lineno, override=False):
209 """Set the line numbers of the node and children."""

Callers 3

parse_withMethod · 0.45
parse_signatureMethod · 0.45
parse_assign_targetMethod · 0.45

Calls 3

popleftMethod · 0.80
extendMethod · 0.45
iter_child_nodesMethod · 0.45

Tested by

no test coverage detected