mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
nested list comprehension with brackets: parser failed; fixes #26
This commit is contained in:
@@ -1464,7 +1464,7 @@ class PyFuzzyParser(object):
|
|||||||
other_level = 0
|
other_level = 0
|
||||||
|
|
||||||
for i, tok in enumerate(reversed(tok_list)):
|
for i, tok in enumerate(reversed(tok_list)):
|
||||||
if not isinstance(tok, Name):
|
if not isinstance(tok, (Name, ListComprehension)):
|
||||||
tok = tok[1]
|
tok = tok[1]
|
||||||
if tok in closing_brackets:
|
if tok in closing_brackets:
|
||||||
other_level -= 1
|
other_level -= 1
|
||||||
|
|||||||
@@ -134,6 +134,14 @@ b = [b for arr in [[[1.0]]] for a in arr for b in a]
|
|||||||
#? float()
|
#? float()
|
||||||
b[0]
|
b[0]
|
||||||
|
|
||||||
|
# jedi issue #26
|
||||||
|
#? list()
|
||||||
|
a = [[int(v) for v in line.strip().split() if v] for line in ["123", "123", "123"] if line]
|
||||||
|
#? list()
|
||||||
|
a[0]
|
||||||
|
#? int()
|
||||||
|
a[0][0]
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# ternary operator
|
# ternary operator
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user