Skip to content

Commit 41586ee

Browse files
committed
Fix roundtrip parsing of multiline string literals.
1 parent 9322334 commit 41586ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/selfie-lib/selfie_lib/SourceFile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ def parse_to_be_like(self, line_one_indexed: int) -> ToBeLiteral:
156156
end_arg = -1
157157
end_paren = 0
158158
if self._content_slice[arg_start] == '"':
159-
if self._content_slice[arg_start].startswith(self.TRIPLE_QUOTE):
159+
if self._content_slice.subSequence(
160+
arg_start, len(self._content_slice)
161+
).starts_with(self.TRIPLE_QUOTE):
160162
end_arg = self._content_slice.indexOf(
161163
self.TRIPLE_QUOTE, arg_start + len(self.TRIPLE_QUOTE)
162164
)

0 commit comments

Comments
 (0)