1
0
forked from VimPlug/jedi

fixed the last remaining problems with fast_parser (not cached yet)

This commit is contained in:
David Halter
2012-12-16 03:50:50 +01:00
parent bcdf273c21
commit 36b75c3e15
3 changed files with 15 additions and 4 deletions

View File

@@ -183,6 +183,13 @@ class FastParser(use_metaclass(CachedFastParser)):
r'(?=\n(?:def|class|@)|$)'
parts = re.findall(r, code, re.DOTALL)
if len(parts) > 1 and not re.match('def|class|@', parts[0]):
# Merge the first two because `common.NoErrorTokenizer` is not able
# to know if there's a class/func or not.
# Therefore every part has it's own class/func. Exactly one.
parts[0] += parts[1]
parts.pop(1)
line_offset = 0
start = 0
p = None