Skip to content

Commit

Permalink
Remove RPYC v1 support, Screenlanguage v1 support, --tag-outside-bloc…
Browse files Browse the repository at this point in the history
…k support, and Revertable classes in renpy.python.
  • Loading branch information
CensoredUsername committed Feb 20, 2024
1 parent 12b492b commit 7b0dc8b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 747 deletions.
18 changes: 4 additions & 14 deletions decompiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,26 @@
magic.fake_package(b"renpy")
import renpy

import screendecompiler
import sl2decompiler
import testcasedecompiler
import atldecompiler
import codegen
import astdump

__all__ = ["astdump", "codegen", "magic", "screendecompiler", "sl2decompiler", "testcasedecompiler", "translate", "util", "Options", "pprint", "Decompiler"]
__all__ = ["astdump", "codegen", "magic", "sl2decompiler", "testcasedecompiler", "translate", "util", "Options", "pprint", "Decompiler"]

# Main API

# Object that carries configurable decompilation options
class Options(OptionBase):
def __init__(self, indentation=" ", printlock=None, decompile_python=False,
translator=None, init_offset=False, tag_outside_block=False,
def __init__(self, indentation=" ", printlock=None,
translator=None, init_offset=False,
sl_custom_names=None):
super(Options, self).__init__(indentation=indentation, printlock=printlock)

# decompilation options
self.decompile_python = decompile_python
self.translator = translator
self.init_offset = init_offset
self.tag_outside_block = tag_outside_block
self.sl_custom_names = sl_custom_names

def pprint(out_file, ast, options=Options()):
Expand Down Expand Up @@ -817,14 +814,7 @@ def print_translateblock(self, ast):
def print_screen(self, ast):
self.require_init()
screen = ast.screen
if isinstance(screen, renpy.screenlang.ScreenLangScreen):
self.linenumber = screendecompiler.pprint(
self.out_file, screen, self.options,
self.indent_level, self.linenumber, self.skip_indent_until_write
)
self.skip_indent_until_write = False

elif isinstance(screen, renpy.sl2.slast.SLScreen):
if isinstance(screen, renpy.sl2.slast.SLScreen):
self.linenumber = sl2decompiler.pprint(
self.out_file, screen, self.options,
self.indent_level, self.linenumber, self.skip_indent_until_write
Expand Down
Loading

0 comments on commit 7b0dc8b

Please sign in to comment.