Skip to content

Commit

Permalink
Support for index expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Dec 31, 2018
1 parent 65a43d2 commit e8c33f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion decompiler/sl2decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def print_for(self, ast):
children = ast.children

self.indent()
self.write("for %sin %s:" % (variable, ast.expression))
if hasattr(ast, "index_expression") and ast.index_expression is not None:
self.write("for %sindex %s in %s:" % (variable, ast.index_expression, ast.expression))

else:
self.write("for %sin %s:" % (variable, ast.expression))

# Interestingly, for doesn't contain a block, but just a list of child nodes
self.print_nodes(children, 1)
Expand Down

0 comments on commit e8c33f0

Please sign in to comment.