(self, scope_type: ScopeType)
| 220 | return self.scopes[-1] |
| 221 | |
| 222 | def enter_scope(self, scope_type: ScopeType) -> None: |
| 223 | assert len(self._scope().branch_stmts) > 0 |
| 224 | initial_state = None |
| 225 | if scope_type == ScopeType.Generator: |
| 226 | # Generators are special because they inherit the outer scope. |
| 227 | initial_state = self._scope().branch_stmts[-1].branches[-1] |
| 228 | self.scopes.append(Scope([BranchStatement(initial_state)], scope_type)) |
| 229 | |
| 230 | def exit_scope(self) -> None: |
| 231 | self.scopes.pop() |
no test coverage detected