Skip to content

Commit

Permalink
Handle passing args to use expressions properly
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Feb 10, 2020
1 parent ea904bc commit 894f52e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions decompiler/sl2decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,15 @@ def print_use(self, ast):
# A use statement requires reconstructing the arguments it wants to pass
self.indent()
self.write("use ")
args = reconstruct_arginfo(ast.args)
if isinstance(ast.target, PyExpr):
self.write("expression ")
self.write("%s%s" % (ast.target, reconstruct_arginfo(ast.args)))
self.write("expression %s" % ast.target)
if args:
self.write(" pass ")
else:
self.write("%s" % ast.target)

self.write("%s" % reconstruct_arginfo(ast.args))
if hasattr(ast, 'id') and ast.id is not None:
self.write(" id %s" % ast.id)

Expand Down

0 comments on commit 894f52e

Please sign in to comment.