mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
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():
|
elif tok in brackets.keys():
|
||||||
level += 1
|
level += 1
|
||||||
|
|
||||||
if level == -1 and tok in closing_brackets \
|
if level == -1 or level == 0 and (
|
||||||
or tok in added_breaks \
|
tok == ','
|
||||||
or level == 0 and (
|
or tok in added_breaks
|
||||||
tok == ','
|
or maybe_dict and tok == ':'
|
||||||
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
|
end_pos = end_pos[0], end_pos[1] - 1
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ a = [a if 1.0 else '' for a in [1] if [1.0]]
|
|||||||
#? int() str()
|
#? int() str()
|
||||||
a[0]
|
a[0]
|
||||||
|
|
||||||
# with a dict in between
|
# with a dict literal
|
||||||
#? int()
|
#? int()
|
||||||
[a for a,b in {1:2}.items()][0]
|
[a for a,b in {1:2}.items()][0]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user