forked from VimPlug/jedi
Fix the remaining fast parser issues.
This commit is contained in:
@@ -351,8 +351,11 @@ class Parser(object):
|
|||||||
if newline.value == '':
|
if newline.value == '':
|
||||||
# Must be a DEDENT, just continue.
|
# Must be a DEDENT, just continue.
|
||||||
newline = newline.get_previous()
|
newline = newline.get_previous()
|
||||||
|
elif newline.value != '\n':
|
||||||
|
# This may happen if error correction strikes and removes
|
||||||
|
# a whole statement including '\n'.
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
assert newline.value == '\n'
|
|
||||||
newline.value = ''
|
newline.value = ''
|
||||||
if self._last_failed_start_pos > newline._start_pos:
|
if self._last_failed_start_pos > newline._start_pos:
|
||||||
# It may be the case that there was a syntax error in a
|
# It may be the case that there was a syntax error in a
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ class DocstringMixin(object):
|
|||||||
if isinstance(self, SubModule):
|
if isinstance(self, SubModule):
|
||||||
stmt = self.children[0]
|
stmt = self.children[0]
|
||||||
else:
|
else:
|
||||||
stmt = self.children[-1]
|
stmt = self.children[self.children.index(':') + 1]
|
||||||
if is_node(stmt, 'suite'): # Normally a suite
|
if is_node(stmt, 'suite'): # Normally a suite
|
||||||
stmt = stmt.children[2] # -> NEWLINE INDENT stmt
|
stmt = stmt.children[2] # -> NEWLINE INDENT stmt
|
||||||
if is_node(stmt, 'simple_stmt'):
|
if is_node(stmt, 'simple_stmt'):
|
||||||
|
|||||||
Reference in New Issue
Block a user