(
self,
tokensource: Iterable[MutableMapping[_TokenType, str]],
outfile: TextIO,
)
| 115 | super().__init__(**options) |
| 116 | |
| 117 | def format( |
| 118 | self, |
| 119 | tokensource: Iterable[MutableMapping[_TokenType, str]], |
| 120 | outfile: TextIO, |
| 121 | ) -> None: |
| 122 | o: str = "" |
| 123 | for token, text in tokensource: |
| 124 | if text == "\n": |
| 125 | continue |
| 126 | |
| 127 | while token not in self.f_strings: |
| 128 | if token.parent is None: |
| 129 | break |
| 130 | else: |
| 131 | token = token.parent |
| 132 | o += f"{self.f_strings[token]}\x03{text}\x04" |
| 133 | outfile.write(o.rstrip()) |
| 134 | |
| 135 | |
| 136 | # vim: sw=4 ts=4 sts=4 ai et |
no test coverage detected