Skip to content
Browse files

Fix visitors when node.init is a UnaryOp

  • Loading branch information...
1 parent 13c53fb commit 1a2e6e79356d3a5b48598cc5ef9f9a9c8f18b8fe @agriffis agriffis committed May 20, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 src/slimit/visitors/ecmavisitor.py
  2. +1 −1 src/slimit/visitors/minvisitor.py
View
3 src/slimit/visitors/ecmavisitor.py
@@ -137,7 +137,8 @@ def visit_For(self, node):
s += self.visit(node.init)
if node.init is None:
s += ' ; '
- elif isinstance(node.init, (ast.Assign, ast.Comma, ast.FunctionCall)):
+ elif isinstance(node.init, (ast.Assign, ast.Comma, ast.FunctionCall,
+ ast.UnaryOp)):
s += '; '
else:
s += ' '
View
2 src/slimit/visitors/minvisitor.py
@@ -163,7 +163,7 @@ def visit_For(self, node):
if node.init is None:
s += ';'
elif isinstance(node.init, (ast.Assign, ast.Comma, ast.Conditional,
- ast.FunctionCall)):
+ ast.FunctionCall, ast.UnaryOp)):
s += ';'
else:
s += ''

0 comments on commit 1a2e6e7

Please sign in to comment.
Something went wrong with that request. Please try again.