CensoredUsername / unrpyc

A ren'py script decompiler
Other
859 stars 156 forks source link

Dev_py3: Possible missing colons in decompiled v8.2 files #188

Closed madeddy closed 7 months ago

madeddy commented 7 months ago

I decompiled AOSC (modified engine) without errors besides "Unknown AST nodes" and did try to run the app. The following errors came up:

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.

File "game/screen/other.rpy", line 341: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    modal True
    ^

File "game/screens.rpy", line 518: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

File "game/screens.rpy", line 534: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

File "game/screens.rpy", line 608: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

File "game/screens.rpy", line 882: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

File "game/screens.rpy", line 1003: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    predict False
    ^

File "game/screens.rpy", line 1462: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100 predict False
    ^

File "game/screens.rpy", line 1640: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

File "game/screens.rpy", line 1671: Line is indented, but the preceding tag statement does not expect a block. Please check this line's indentation. You may have forgotten a colon (:).
    zorder 100
    ^

Ren'Py Version: Ren'Py 8.2.0.24012202+nightly
Thu Feb 22 11:17:28 2024
CensoredUsername commented 7 months ago

Sounds like a colon is missing after a screen statement. Investigating.

CensoredUsername commented 7 months ago

... ah so that was what --tag-outside-block was dealing with again.

The tag keyword is special cased in the sl2 parser for some reason, compared to literally every other keyword, you're not allowed to start a block after it.

so the line init -505 screen save() tag menu: which unrpyc generates because it cannot figure out where to place the tag statement from the file, is not valid. the tag statement should've been merged in the following keyword line. Guess I've got to change that logic again.

CensoredUsername commented 7 months ago

Should be fixed again in 4d507cf

madeddy commented 7 months ago

Oh man. Id did manage to dig you a good amount of work up, hm. 😅 This doesn't give me anymore errors, so i believe i can close it shortly.

CensoredUsername commented 7 months ago

Ok!