From 0882849e65c172ea8ac9774b813b675952d91460 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 7 May 2017 14:52:46 +0200 Subject: [PATCH] Don't do a simple_stmt error recovery in the parser, because it makes it more complicated. --- jedi/parser/python/parser.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/jedi/parser/python/parser.py b/jedi/parser/python/parser.py index 2fb9d2f3..7b91e268 100644 --- a/jedi/parser/python/parser.py +++ b/jedi/parser/python/parser.py @@ -144,22 +144,9 @@ class Parser(BaseParser): elif symbol == 'suite' and len(nodes) > 1: # suites without an indent in them get discarded. break - elif symbol == 'simple_stmt' and len(nodes) > 1: - # simple_stmt can just be turned into a PythonNode, if - # there are enough statements. Ignore the rest after that. - break return index, symbol, nodes index, symbol, nodes = current_suite(stack) - if symbol == 'simple_stmt': - index -= 2 - (_, _, (type_, suite_nodes)) = stack[index] - symbol = grammar.number2symbol[type_] - suite_nodes.append(tree.PythonNode(symbol, list(nodes))) - # Remove - nodes[:] = [] - nodes = suite_nodes - stack[index] # print('err', token.tok_name[typ], repr(value), start_pos, len(stack), index) if self._stack_removal(grammar, stack, arcs, index + 1, value, start_pos):