1
0
forked from VimPlug/jedi

Fix an issue with omited dedents in the parser.

This commit is contained in:
Dave Halter
2015-02-05 00:09:16 +01:00
parent e1c623d3f3
commit dce952aec6
3 changed files with 53 additions and 29 deletions

View File

@@ -627,10 +627,11 @@ class FastTokenizer(object):
# information. However we care about "lost" lines. The prefix of
# the current line (indent) will always be included in the current
# line.
if self.current[0] == DEDENT:
prefix = next(self._gen)[3]
else:
prefix = self.current[3]
cur = self.current
while cur[0] == DEDENT:
cur = next(self._gen)
prefix = cur[3]
# \Z for the end of the string. $ is bugged, because it has the
# same behavior with or without re.MULTILINE.
prefix = re.sub(r'[^\n]+\Z', '', prefix)