Skip to content

Commit

Permalink
Decompile menu item arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Feb 24, 2020
1 parent 4fbcf8f commit f1d7098
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion decompiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,12 @@ def print_menu(self, ast):
self.indent()
self.write("set %s" % ast.set)

for label, condition, block in ast.items:
if hasattr(ast, "item_arguments"):
item_arguments = ast.item_arguments
else:
item_arguments = [None] * len(ast.items)

for (label, condition, block), arguments in zip(ast.items, item_arguments):
if self.translator:
label = self.translator.strings.get(label, label)

Expand All @@ -642,6 +647,9 @@ def print_menu(self, ast):
self.indent()
self.write('"%s"' % string_escape(label))

if arguments is not None:
self.write(reconstruct_arginfo(arguments))

if block is not None:
if isinstance(condition, unicode):
self.write(" if %s" % condition)
Expand Down

0 comments on commit f1d7098

Please sign in to comment.