(state: State, data: ReadBuffer)
| 1210 | |
| 1211 | |
| 1212 | def read_optional_block(state: State, data: ReadBuffer) -> Block | None: |
| 1213 | expect_tag(data, nodes.BLOCK) |
| 1214 | expect_tag(data, LIST_GEN) |
| 1215 | n = read_int_bare(data) |
| 1216 | is_unreachable = read_bool(data) |
| 1217 | if n == 0: |
| 1218 | b = None |
| 1219 | else: |
| 1220 | a = [read_statement(state, data) for i in range(n)] |
| 1221 | b = Block(a, is_unreachable=is_unreachable) |
| 1222 | b.line = a[0].line |
| 1223 | b.column = a[0].column |
| 1224 | b.end_line = a[-1].end_line |
| 1225 | b.end_column = a[-1].end_column |
| 1226 | expect_end_tag(data) |
| 1227 | return b |
| 1228 | |
| 1229 | |
| 1230 | bin_ops: Final = ["+", "-", "*", "@", "/", "%", "**", "<<", ">>", "|", "^", "&", "//"] |
no test coverage detected
searching dependent graphs…