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

Function assemble_logical_lines

IPython/core/inputtransformer.py:175–193  ·  view source on GitHub ↗

r"""Join lines following explicit line continuations (\)

()

Source from the content-addressed store, hash-verified

173
174@CoroutineInputTransformer.wrap
175def assemble_logical_lines():
176 r"""Join lines following explicit line continuations (\)"""
177 line = ''
178 while True:
179 line = (yield line)
180 if not line or line.isspace():
181 continue
182
183 parts = []
184 while line is not None:
185 if line.endswith('\\') and (not has_comment(line)):
186 parts.append(line[:-1])
187 line = (yield None) # Get another line
188 else:
189 parts.append(line)
190 break
191
192 # Output
193 line = ''.join(parts)
194
195# Utilities
196def _make_help_call(target, esc, lspace, next_input=None):

Callers 1

__init__Method · 0.90

Calls 1

has_commentFunction · 0.85

Tested by

no test coverage detected