feat: converter accepts the constructs of goodluke and SaintlyCorruption
`init -490 screen`, `import x as y` and `from m import A as B`, classes with @renpy.pure, pickle hooks
on classes, `*` items in tuples and lists, generator functions (yield statements; the player runs them
to the end), multi-line expressions that need brackets, Null() and Animation() images, images given as
expressions (`"path/{}.png".format(x)`, f-strings), window statements in init, `offset` in ATL, input
widgets with their values and the focus/confirm actions, `continue` and `break` in screens, `drag`
and DiamondBox-style `fixed` with cell_size, `getattr(...)()` calls, transforms called with arguments,
and the whitelist for the new runtime. JSON files of a game are shipped as data files. Also fixes
blocking_names failing on a call of a call during full conversion.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f2fcd05467
commit
e66160cffa
12 files changed
+176
-31
No files matched your search
@@ -80,7 +80,7 @@ def test_renpy_only_declarations_are_not_execution_blockers(tmp_path):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source,reason", [
|
||||
('init python:\n def helper():\n yield 1\nlabel start:\n $ helper()', "init python"),
|
||||
('init python:\n def helper():\n received = yield 1\nlabel start:\n $ helper()', "init python"),
|
||||
('label start:\n $ result = renpy.show_displayable("map")', "renpy.show_displayable"),
|
||||
('label start:\n jump missing', "missing"),
|
||||
])
|
||||
@@ -362,3 +362,14 @@ def test_upload_rejects_unsupported_engine_without_queueing(tmp_path, monkeypatc
|
||||
assert not upload_path(123).exists()
|
||||
finally:
|
||||
get_settings.cache_clear()
|
||||
|
||||
|
||||
def test_blocking_names_survives_a_call_of_a_call():
|
||||
from app.converter.compatibility import blocking_names
|
||||
|
||||
data = ScriptData()
|
||||
source = ('init python:\n def helper():\n return getattr(renpy.store, "x", lambda: 1)()\n'
|
||||
'label start:\n $ helper()\n')
|
||||
data.prescan(source)
|
||||
RpyParser(data, "t.rpy").parse(source)
|
||||
assert blocking_names(data) == []
|
||||
Reference in new issue
Block a user