(self)
| 201 | """DefinedVariableTracker manages the state and scope for the UndefinedVariablesVisitor.""" |
| 202 | |
| 203 | def __init__(self) -> None: |
| 204 | # There's always at least one scope. Within each scope, there's at least one "global" BranchingStatement. |
| 205 | self.scopes: list[Scope] = [Scope([BranchStatement()], ScopeType.Global)] |
| 206 | # disable_branch_skip is used to disable skipping a branch due to a return/raise/etc. This is useful |
| 207 | # in things like try/except/finally statements. |
| 208 | self.disable_branch_skip = False |
| 209 | self.in_finally = False |
| 210 | |
| 211 | def copy(self) -> DefinedVariableTracker: |
| 212 | result = DefinedVariableTracker() |
nothing calls this directly
no test coverage detected