1
0
forked from VimPlug/jedi

suites without indent can also be deleted.

This commit is contained in:
Dave Halter
2014-11-29 13:30:21 +01:00
parent a7560069b0
commit 417db4e83f

View File

@@ -213,7 +213,10 @@ class Parser(object):
for index, (dfa, state, (typ, nodes)) in reversed(list(enumerate(stack))):
# `suite` can sometimes be only simple_stmt, not stmt.
symbol = grammar.number2symbol[typ]
if symbol in ('file_input', 'suite'):
if symbol == 'file_input':
break
elif symbol == 'suite' and len(nodes) > 1:
# suites without an indent in them get discarded.
break
return index, symbol, nodes