A context manager for preparing the source for blocks. It adds the character':', increases the indentation on enter and decreases the indentation on exit. If *extra* is given, it will be directly appended after the colon character.
(self, *, extra = None)
| 117 | |
| 118 | @contextmanager |
| 119 | def block(self, *, extra = None): |
| 120 | """A context manager for preparing the source for blocks. It adds |
| 121 | the character':', increases the indentation on enter and decreases |
| 122 | the indentation on exit. If *extra* is given, it will be directly |
| 123 | appended after the colon character. |
| 124 | """ |
| 125 | self.write(":") |
| 126 | if extra: |
| 127 | self.write(extra) |
| 128 | self._indent += 1 |
| 129 | yield |
| 130 | self._indent -= 1 |
| 131 | |
| 132 | @contextmanager |
| 133 | def delimit(self, start, end): |