fix for an issue with commas in statements

This commit is contained in:
Dave Halter
2014-05-04 02:20:46 +02:00
parent 8404107397
commit e0d0572d7f
2 changed files with 6 additions and 2 deletions

View File

@@ -1128,7 +1128,7 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c)
elif tok_str == '.':
if result and isinstance(result[-1], StatementElement):
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
stmt = Statement(self._sub_module, result, result[0].start_pos,
tok.end_pos, self.parent, set_name_parents=False)

View File

@@ -168,7 +168,11 @@ invalid = .call
#? str()
invalid
call = ''
invalid = call?.call
#? str()
invalid
# comma
invalid = ,call
#? str()
invalid