| 205 | |
| 206 | @dataclass |
| 207 | class BlockStmt(Stmt): |
| 208 | open: lx.Token |
| 209 | body: list[Stmt] |
| 210 | close: lx.Token |
| 211 | |
| 212 | def print(self, out:CWriter) -> None: |
| 213 | out.emit(self.open) |
| 214 | for stmt in self.body: |
| 215 | stmt.print(out) |
| 216 | out.start_line() |
| 217 | out.emit(self.close) |
| 218 | |
| 219 | def accept(self, visitor: Visitor) -> None: |
| 220 | visitor(self) |
| 221 | for stmt in self.body: |
| 222 | stmt.accept(visitor) |
| 223 | |
| 224 | def tokens(self) -> Iterator[lx.Token]: |
| 225 | yield self.open |
| 226 | for stmt in self.body: |
| 227 | yield from stmt.tokens() |
| 228 | yield self.close |
| 229 | |
| 230 | |
| 231 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…