Open dideler opened 9 years ago
This looks like it's caused by this line: https://github.com/differentmatt/filbert/blob/master/filbert.js#L1844
Filbert assumes if there's an opening (
, then it's an expression wrapped in parentheses like if (foo() and bar()):
and calls parseParenExpression()
. But it could also be a tuple.
parseParenExpression()
consumes the outer parentheses and returns the enclosed expression.
https://github.com/differentmatt/filbert/blob/master/filbert.js#L1997-L2005
So a conditional like
if ():
becomes
if :
which is invalid.
This also means that the following code doesn't raise an error
t = ()
if t:
since it doesn't call parseParenExpression()
Also note that the following should raise an error but doesn't:
if (1, 2):
# becomes
if 1, 2: # Should raise "SyntaxError: invalid syntax"