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