forked from VimPlug/jedi
Fix DEDENT issues in _remove_newline.
This commit is contained in:
@@ -318,4 +318,11 @@ class Parser(object):
|
|||||||
endmarker.prefix = endmarker.prefix[:-1]
|
endmarker.prefix = endmarker.prefix[:-1]
|
||||||
else:
|
else:
|
||||||
newline = endmarker.get_previous()
|
newline = endmarker.get_previous()
|
||||||
newline.value = ''
|
while True:
|
||||||
|
if newline.value == '':
|
||||||
|
# Must be a DEDENT, just continue.
|
||||||
|
newline = newline.get_previous()
|
||||||
|
else:
|
||||||
|
assert newline.value == '\n'
|
||||||
|
newline.value = ''
|
||||||
|
break
|
||||||
|
|||||||
@@ -101,3 +101,4 @@ def test_end_newlines():
|
|||||||
test('a\n')
|
test('a\n')
|
||||||
test('a\n\n')
|
test('a\n\n')
|
||||||
test('a\n#comment')
|
test('a\n#comment')
|
||||||
|
test('def a():\n pass')
|
||||||
|
|||||||
Reference in New Issue
Block a user