Iterate through the lines of a multiline string.
(self, token: tokenize.TokenInfo)
| 132 | self._tstring_start = lineno |
| 133 | |
| 134 | def multiline_string(self, token: tokenize.TokenInfo) -> Generator[str]: |
| 135 | """Iterate through the lines of a multiline string.""" |
| 136 | if token.type == FSTRING_END: # pragma: >=3.12 cover |
| 137 | start = self._fstring_start |
| 138 | elif token.type == TSTRING_END: # pragma: >=3.14 cover |
| 139 | start = self._tstring_start |
| 140 | else: |
| 141 | start = token.start[0] |
| 142 | |
| 143 | self.multiline = True |
| 144 | self.line_number = start |
| 145 | # intentionally don't include the last line, that line will be |
| 146 | # terminated later by a future end-of-line |
| 147 | for _ in range(start, token.end[0]): |
| 148 | yield self.lines[self.line_number - 1] |
| 149 | self.line_number += 1 |
| 150 | self.multiline = False |
| 151 | |
| 152 | def reset_blank_before(self) -> None: |
| 153 | """Reset the blank_before attribute to zero.""" |
no outgoing calls