Skip to content

Commit

Permalink
Support SL2 use expression
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Feb 9, 2020
1 parent 5ba8066 commit ea904bc
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 @@ -26,6 +26,7 @@
reconstruct_arginfo, split_logical_lines, Dispatcher

from renpy import ui, sl2
from renpy.ast import PyExpr
from renpy.text import text
from renpy.sl2 import sldisplayables as sld
from renpy.display import layout, behavior, im, motion, dragdrop
Expand Down Expand Up @@ -149,7 +150,10 @@ def print_pass(self, ast):
def print_use(self, ast):
# A use statement requires reconstructing the arguments it wants to pass
self.indent()
self.write("use %s%s" % (ast.target, reconstruct_arginfo(ast.args)))
self.write("use ")
if isinstance(ast.target, PyExpr):
self.write("expression ")
self.write("%s%s" % (ast.target, 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 ea904bc

Please sign in to comment.