mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
fix for an issue with commas in statements
This commit is contained in:
@@ -1128,7 +1128,7 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c)
|
|||||||
elif tok_str == '.':
|
elif tok_str == '.':
|
||||||
if result and isinstance(result[-1], StatementElement):
|
if result and isinstance(result[-1], StatementElement):
|
||||||
is_chain = True
|
is_chain = True
|
||||||
elif tok_str == ',': # implies a tuple
|
elif tok_str == ',' and result: # implies a tuple
|
||||||
# expression is now an array not a statement anymore
|
# expression is now an array not a statement anymore
|
||||||
stmt = Statement(self._sub_module, result, result[0].start_pos,
|
stmt = Statement(self._sub_module, result, result[0].start_pos,
|
||||||
tok.end_pos, self.parent, set_name_parents=False)
|
tok.end_pos, self.parent, set_name_parents=False)
|
||||||
|
|||||||
@@ -168,7 +168,11 @@ invalid = .call
|
|||||||
#? str()
|
#? str()
|
||||||
invalid
|
invalid
|
||||||
|
|
||||||
call = ''
|
|
||||||
invalid = call?.call
|
invalid = call?.call
|
||||||
#? str()
|
#? str()
|
||||||
invalid
|
invalid
|
||||||
|
|
||||||
|
# comma
|
||||||
|
invalid = ,call
|
||||||
|
#? str()
|
||||||
|
invalid
|
||||||
|
|||||||
Reference in New Issue
Block a user