Ren'Py supports an "init label" statement. Its own AST block is completely indistinguishable from a regular "label" statement. However, things that normally automatically generate an init block if they're not in one (image, define, default, transform, screen, testcase, translate strings, and style) won't do so inside of an init label. We need to detect if any of those exist outside of an init block inside each label, and if so, generate an init label instead.
Ren'Py supports an "init label" statement. Its own AST block is completely indistinguishable from a regular "label" statement. However, things that normally automatically generate an init block if they're not in one (image, define, default, transform, screen, testcase, translate strings, and style) won't do so inside of an init label. We need to detect if any of those exist outside of an init block inside each label, and if so, generate an init label instead.