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

Function find_undeclared

src/jinja2/compiler.py:142–154  ·  view source on GitHub ↗

Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.

(
    nodes: t.Iterable[nodes.Node], names: t.Iterable[str]
)

Source from the content-addressed store, hash-verified

140
141
142def find_undeclared(
143 nodes: t.Iterable[nodes.Node], names: t.Iterable[str]
144) -> t.Set[str]:
145 """Check if the names passed are accessed undeclared. The return value
146 is a set of all the undeclared names from the sequence of names found.
147 """
148 visitor = UndeclaredNameVisitor(names)
149 try:
150 for node in nodes:
151 visitor.visit(node)
152 except VisitorExit:
153 pass
154 return visitor.undeclared
155
156
157class MacroRef:

Callers 3

macro_bodyMethod · 0.85
visit_TemplateMethod · 0.85
visit_ForMethod · 0.85

Calls 2

visitMethod · 0.80

Tested by

no test coverage detected