feat: converter reads the Phone library's register statement, named stores and generators
`init phone register` becomes a default (the group chat) plus a function of library calls that runs with the other defaults of a new game (phone_register.py). `init/python [early|hide] in some.store` wraps its code in an in_store node and `default some.store.name` may name a store; yield works as an expression (generator functions are marked gen); `import x as y`, `transform -150 name(...)`, `init:` with if/else, `config.special_namespaces` lines, `at` lists and tuples, transforms made by Python functions, `choice` weights that are expressions, `__len__`/`__bool__`, and the whitelist for os, calendar, itertools, pygame_sdl2 and the new runtime. The converter also records the size of every picture it converts (`imageSizes`) so `renpy.image_size` answers without loading. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e94f9b0d9e
commit
83cc7fdd5c
11 files changed
+379
-26
No files matched your search
@@ -57,10 +57,10 @@ def test_if_chain_and_menu():
|
||||
|
||||
|
||||
def test_unsupported_python_is_reported_not_fatal():
|
||||
d = parse("init python:\n def f():\n received = yield 1\n x = 1\nlabel start:\n $ y = x\n")
|
||||
d = parse("init python:\n def f():\n received = yield from other()\n x = 1\nlabel start:\n $ y = x\n")
|
||||
assert d.init_code[0]["op"] == "set" and "f" in d.deferred # reported once something calls it
|
||||
from app.converter.compatibility import audit_ir
|
||||
d = parse("init python:\n def f():\n received = yield 1\nlabel start:\n $ f()\n")
|
||||
d = parse("init python:\n def f():\n received = yield from other()\nlabel start:\n $ f()\n")
|
||||
audit_ir(d)
|
||||
assert d.blockers
|
||||
|
||||
|
||||
Reference in new issue
Block a user