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]
)
| 140 | |
| 141 | |
| 142 | def 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 | |
| 157 | class MacroRef: |
no test coverage detected