forked from VimPlug/jedi
restructure token breaks in statement parser
This commit is contained in:
@@ -1013,14 +1013,11 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c)
|
||||
elif tok in brackets.keys():
|
||||
level += 1
|
||||
|
||||
if level == -1 and tok in closing_brackets \
|
||||
or tok in added_breaks \
|
||||
or level == 0 and (
|
||||
if level == -1 or level == 0 and (
|
||||
tok == ','
|
||||
or tok in added_breaks
|
||||
or maybe_dict and tok == ':'
|
||||
or is_assignment(tok)
|
||||
and break_on_assignment
|
||||
):
|
||||
or is_assignment(tok) and break_on_assignment):
|
||||
end_pos = end_pos[0], end_pos[1] - 1
|
||||
break
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ a = [a if 1.0 else '' for a in [1] if [1.0]]
|
||||
#? int() str()
|
||||
a[0]
|
||||
|
||||
# with a dict in between
|
||||
# with a dict literal
|
||||
#? int()
|
||||
[a for a,b in {1:2}.items()][0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user