mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 05:11:25 +08:00
Fix DEDENT issues in _remove_newline.
This commit is contained in:
@@ -318,4 +318,11 @@ class Parser(object):
|
||||
endmarker.prefix = endmarker.prefix[:-1]
|
||||
else:
|
||||
newline = endmarker.get_previous()
|
||||
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\n')
|
||||
test('a\n#comment')
|
||||
test('def a():\n pass')
|
||||
|
||||
Reference in New Issue
Block a user