| 2070 | |
| 2071 | |
| 2072 | class IfStmt(Statement): |
| 2073 | __slots__ = ("expr", "body", "else_body", "unreachable_else") |
| 2074 | |
| 2075 | __match_args__ = ("expr", "body", "else_body", "unreachable_else") |
| 2076 | |
| 2077 | expr: list[Expression] |
| 2078 | body: list[Block] |
| 2079 | else_body: Block | None |
| 2080 | # (If there is actually no else statement, semantic analysis may nevertheless create an |
| 2081 | # empty else block and mark it permanently as unreachable to tell that the control flow |
| 2082 | # must always go through the if block.) |
| 2083 | unreachable_else: bool |
| 2084 | # (Type checking may modify this flag repeatedly to indicate whether an actually available |
| 2085 | # or unavailable else block is unreachable, considering the current type information.) |
| 2086 | |
| 2087 | def __init__(self, expr: list[Expression], body: list[Block], else_body: Block | None) -> None: |
| 2088 | super().__init__() |
| 2089 | self.expr = expr |
| 2090 | self.body = body |
| 2091 | self.else_body = else_body |
| 2092 | self.unreachable_else = False |
| 2093 | |
| 2094 | def accept(self, visitor: StatementVisitor[T]) -> T: |
| 2095 | return visitor.visit_if_stmt(self) |
| 2096 | |
| 2097 | |
| 2098 | class RaiseStmt(Statement): |
no outgoing calls
no test coverage detected
searching dependent graphs…