1
0
forked from VimPlug/jedi

The func/class dictionaries must be changed if some scopes are removed by the parser's error recovery.

This commit is contained in:
Dave Halter
2014-11-29 01:29:21 +01:00
parent 43c01afcfc
commit 2b912cb75a

View File

@@ -243,6 +243,9 @@ class Parser(object):
except ValueError:
pass # This may happen with CompFor.
for dfa, state, node in stack[start_index:]:
clear_names(children=node[1])
failed_stack = []
found = False
for dfa, state, (typ, nodes) in stack[start_index:]:
@@ -251,13 +254,12 @@ class Parser(object):
if found:
symbol = grammar.number2symbol[typ]
failed_stack.append((symbol, nodes))
if nodes and nodes[0] in ('def', 'class'):
self.scope_names_stack.pop()
if failed_stack:
err = ErrorStatement(failed_stack, value, start_pos)
self.error_statement_stacks.append(err)
for dfa, state, node in stack[start_index:]:
clear_names(children=node[1])
stack[start_index:] = []
def _tokenize(self, tokenizer):