From 959f7b5e005ff6ac3d9595d04f9f62a665096ab5 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 18 Sep 2016 00:52:22 +0200 Subject: [PATCH] We don't need to reset the last failed start_pos anymore, because this is something that was necessary with the fucked up old parser. --- jedi/parser/__init__.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/jedi/parser/__init__.py b/jedi/parser/__init__.py index 9a8ae09a..5d724e9e 100644 --- a/jedi/parser/__init__.py +++ b/jedi/parser/__init__.py @@ -101,7 +101,6 @@ class Parser(object): self._used_names = {} self._scope_names_stack = [{}] - self._last_failed_start_pos = (0, 0) self._global_names = [] self.source = source @@ -266,16 +265,7 @@ class Parser(object): break else: newline.value = '' - if self._last_failed_start_pos > newline.start_pos: - # It may be the case that there was a syntax error in a - # function. In that case error correction removes the - # right newline. So we use the previously assigned - # _last_failed_start_pos variable to account for that. - endmarker.start_pos = self._last_failed_start_pos - raise NotImplementedError - else: - endmarker.start_pos = newline.start_pos - break + endmarker.start_pos = newline.start_pos class ParserWithRecovery(Parser): @@ -382,8 +372,6 @@ class ParserWithRecovery(Parser): if failed_stack: stack[start_index - 1][2][1].append(pt.ErrorNode(all_nodes)) - self._last_failed_start_pos = start_pos - stack[start_index:] = [] return failed_stack