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

Class DependencyFinderVisitor

src/jinja2/compiler.py:252–268  ·  view source on GitHub ↗

A visitor that collects filter and test calls.

Source from the content-addressed store, hash-verified

250
251
252class DependencyFinderVisitor(NodeVisitor):
253 """A visitor that collects filter and test calls."""
254
255 def __init__(self) -> None:
256 self.filters: t.Set[str] = set()
257 self.tests: t.Set[str] = set()
258
259 def visit_Filter(self, node: nodes.Filter) -> None:
260 self.generic_visit(node)
261 self.filters.add(node.name)
262
263 def visit_Test(self, node: nodes.Test) -> None:
264 self.generic_visit(node)
265 self.tests.add(node.name)
266
267 def visit_Block(self, node: nodes.Block) -> None:
268 """Stop visiting at blocks."""
269
270
271class UndeclaredNameVisitor(NodeVisitor):

Callers 1

pull_dependenciesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected