feat: ATL durations in brackets, offset and GPU hints; screen for-index, glued strings and onlayer
ATL: `ease(1.0) zoom 1.3`, `ease (0.1)xpos 0.5`, `ease(0.1)rotate 5` and `pause(1.5)` take the duration
in brackets; `offset (x, y)` becomes xoffset/yoffset; lines starting with shader, mesh, u_*, blend or
transform_anchor are skipped as GPU hints. thelewdesthouse drops from about 1400 to 111 rejections.
Screens: `for x index k in seq`, `add"x"` without a space, and `onlayer name` after show/call screen
(the layer is ignored, every screen lives in one layer). Transforms named with a capital letter and
declared in another file are resolved by the prescan, and `__("Name") "text"` is a translatable speaker.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
25bd39dd43
commit
5c1e1aee01
4 files changed
+84
-5
No files matched your search
@@ -176,6 +176,7 @@ class ScreenParser:
|
||||
while i < len(lines):
|
||||
line = lines[i]
|
||||
text = line.text.rstrip(":").strip() if line.block else line.text.strip()
|
||||
text = re.sub(r"^(add|text|label|image|textbutton)(?=[\"'])", r"\1 ", text) # `add"cover"`
|
||||
words = tokens(re.sub(r"^(if|elif|showif)\(", r"\1 (", text))
|
||||
i += 1
|
||||
if not words:
|
||||
@@ -260,8 +261,10 @@ class ScreenParser:
|
||||
return {"c": cond, "body": body, "props": props}
|
||||
|
||||
def for_loop(self, line: Line) -> Node | None:
|
||||
# `for item index item.id in items:`: the index only keys the widgets, the loop is the same
|
||||
source = re.sub(r"\s+index\s+.+?\s+in\s+", " in ", line.text.strip().rstrip(":"), count=1)
|
||||
try:
|
||||
stmt = pyexpr.parse_stmts(line.text.strip().rstrip(":") + ":\n pass")[0]
|
||||
stmt = pyexpr.parse_stmts(source + ":\n pass")[0]
|
||||
except Unsupported as exc:
|
||||
self.warn(f"Цикл в screen: {exc}", line)
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user