Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Dec 30, 2014
2 parents 7b22c59 + b71f86a commit 7a6ebfa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions decompiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ def print_translatestring(self, ast):
self.indent_level += 1

self.indent()
self.write('old "%s"' % escape_string(ast.old))
self.write('old "%s"' % string_escape(ast.old))
self.indent()
self.write('new "%s"' % escape_string(ast.new))
self.write('new "%s"' % string_escape(ast.new))

self.indent_level -= 1
dispatch[renpy.ast.TranslateString] = print_translatestring
Expand Down
19 changes: 15 additions & 4 deletions decompiler/sl2decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,22 @@ def _print_if(self, ast, keyword):
self.write("%s %s:" % (keyword(), condition))

# Every condition has a block of type slast.SLBlock
self.print_block(block, 1)
self.print_block(block)

def print_block(self, ast, extra_indent=0):
# A block just contains a list of children
self.print_nodes(ast.children, extra_indent)
def print_block(self, ast):
# A block contains possible keyword arguments and a list of child nodes
# this is the reason if doesn't keep a list of children but special Blocks
self.indent_level += 1

for key, value in ast.keyword:
if ' ' in value:
value = '(%s)' % value

self.indent()
self.write("%s %s" % (key, value))

self.print_nodes(ast.children)
self.indent_level -= 1
dispatch[sl2.slast.SLBlock] = print_block

def print_for(self, ast):
Expand Down

0 comments on commit 7a6ebfa

Please sign in to comment.