mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-21 23:18:26 +08:00
suites without indent can also be deleted.
This commit is contained in:
@@ -213,7 +213,10 @@ class Parser(object):
|
|||||||
for index, (dfa, state, (typ, nodes)) in reversed(list(enumerate(stack))):
|
for index, (dfa, state, (typ, nodes)) in reversed(list(enumerate(stack))):
|
||||||
# `suite` can sometimes be only simple_stmt, not stmt.
|
# `suite` can sometimes be only simple_stmt, not stmt.
|
||||||
symbol = grammar.number2symbol[typ]
|
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
|
break
|
||||||
return index, symbol, nodes
|
return index, symbol, nodes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user