if node.ctx in ('store', 'param'):
self.identifiers.declared_locally.add(node.name)
elif node.ctx == 'load':
- if not self.identifiers.is_declared(node.name):
+ if not self.identifiers.is_declared(node.name, self.hard_scope):
self.identifiers.undeclared.add(node.name)
+ def visit_FilterCall(self, node):
+ if not node.name in self.identifiers.declared_filter:
+ uf = self.identifiers.undeclared_filter.get(node.name, 0) + 1
+ if uf > 1:
+ self.identifiers.declared_filter.add(node.name)
+ self.identifiers.undeclared_filter[node.name] = uf
+
def visit_Macro(self, node):
"""Macros set local."""
self.identifiers.declared_locally.add(node.name)