| 149 | |
| 150 | @dataclass |
| 151 | class WhileStmt(Stmt): |
| 152 | while_: lx.Token |
| 153 | condition: list[lx.Token] |
| 154 | body: Stmt |
| 155 | |
| 156 | def print(self, out:CWriter) -> None: |
| 157 | out.emit(self.while_) |
| 158 | for tkn in self.condition: |
| 159 | out.emit(tkn) |
| 160 | self.body.print(out) |
| 161 | |
| 162 | def accept(self, visitor: Visitor) -> None: |
| 163 | visitor(self) |
| 164 | self.body.accept(visitor) |
| 165 | |
| 166 | def tokens(self) -> Iterator[lx.Token]: |
| 167 | yield self.while_ |
| 168 | yield from self.condition |
| 169 | yield from self.body.tokens() |
| 170 | |
| 171 | |
| 172 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…