forked from VimPlug/jedi
Trying to move the indent/dedent logic back into the tokenizer.
This commit is contained in:
@@ -208,13 +208,13 @@ class Parser(object):
|
||||
"""
|
||||
# For now just discard everything that is not a suite or
|
||||
# file_input, if we detect an error.
|
||||
for i, (dfa, state, (_type, _)) in reversed(list(enumerate(stack))):
|
||||
for index, (dfa, state, (_type, _)) in reversed(list(enumerate(stack))):
|
||||
# `suite` can sometimes be only simple_stmt, not stmt.
|
||||
symbol = grammar.number2symbol[_type]
|
||||
if symbol in ('file_input', 'suite'):
|
||||
index = i
|
||||
break
|
||||
# No success finding a transition
|
||||
print('err', tokenize.tok_name[typ], repr(value), start_pos, len(stack), index)
|
||||
self._stack_removal(grammar, stack, index + 1, value, start_pos)
|
||||
|
||||
def _stack_removal(self, grammar, stack, start_index, value, start_pos):
|
||||
|
||||
Reference in New Issue
Block a user