MCPcopy
hub / github.com/pallets/jinja / set_lineno

Method set_lineno

src/jinja2/nodes.py:220–229  ·  view source on GitHub ↗

Set the line numbers of the node and children.

(self, lineno: int, override: bool = False)

Source from the content-addressed store, hash-verified

218 return self
219
220 def set_lineno(self, lineno: int, override: bool = False) -> "Node":
221 """Set the line numbers of the node and children."""
222 todo = deque([self])
223 while todo:
224 node = todo.popleft()
225 if "lineno" in node.attributes:
226 if node.lineno is None or override:
227 node.lineno = lineno
228 todo.extend(node.iter_child_nodes())
229 return self
230
231 def set_environment(self, environment: "Environment") -> "Node":
232 """Set the environment for all nodes."""

Callers 3

parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80

Calls 2

extendMethod · 0.80
iter_child_nodesMethod · 0.80

Tested by 1

parseMethod · 0.64