From fc861313cee6fc5fe5fadd36fdad180df354e67a Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 9 Oct 2012 15:01:32 +0200 Subject: [PATCH] fixed statement parsing problem of list slicing --- jedi/parsing.py | 3 +-- test/completion/arrays.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jedi/parsing.py b/jedi/parsing.py index 9e7d2471..0b70f612 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -751,7 +751,6 @@ class Statement(Simple): close_brackets = False if type(result) == Call: result = result.parent() - close_brackets = False call = Call(tok, c_type, start_pos, parent=result) result.add_to_current_field(call) result = call @@ -765,7 +764,7 @@ class Statement(Simple): result = Array(start_pos, brackets[tok], parent=result) result.parent().add_to_current_field(result) elif tok == ':': - if is_call_or_close(): + while is_call_or_close(): result = result.parent() close_brackets = False if result.type == Array.LIST: # [:] lookups diff --git a/test/completion/arrays.py b/test/completion/arrays.py index 9c8a143d..b9ddcb61 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -30,6 +30,9 @@ b[8-7] #? list() b[8:] +#? list() +b[int():] + # ----------------- # iterable multiplication