MCPcopy Create free account
hub / github.com/ipython/ipython / find_end_of_continued_line

Function find_end_of_continued_line

IPython/core/inputtransformer2.py:122–132  ·  view source on GitHub ↗

Find the last line of a line explicitly extended using backslashes. Uses 0-indexed line numbers.

(lines, start_line: int)

Source from the content-addressed store, hash-verified

120 paren_level -= 1
121
122def find_end_of_continued_line(lines, start_line: int):
123 """Find the last line of a line explicitly extended using backslashes.
124
125 Uses 0-indexed line numbers.
126 """
127 end_line = start_line
128 while lines[end_line].endswith('\\\n'):
129 end_line += 1
130 if end_line >= len(lines):
131 break
132 return end_line
133
134def assemble_continued_line(lines, start: Tuple[int, int], end_line: int):
135 r"""Assemble a single line from multiple continued line pieces

Callers 3

transformMethod · 0.85
transformMethod · 0.85
transformMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected