wave N+3: vfbuild18 fixes (aas EF lambda copy in attach)
This commit is contained in:
parent
9411ff3dbe
commit
d45625b3e0
3 changed files with 68 additions and 3 deletions
34
tools/waves_n3.py
Normal file
34
tools/waves_n3.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Волна N+3: vfbuild18 — 3 EF в aas.java (lambda capture var1). Запуск: python3 tools/waves_n3.py"""
|
||||
|
||||
import os, sys
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
JAVA = os.path.join(ROOT, "src/main/java")
|
||||
REL = "defpackage/aas.java"
|
||||
p = os.path.join(JAVA, REL)
|
||||
L = open(p, encoding="utf-8", errors="replace").read().splitlines()
|
||||
ok = True
|
||||
|
||||
|
||||
def edit(ln, old, new):
|
||||
global ok
|
||||
i = ln - 1
|
||||
if i < len(L) and old in L[i]:
|
||||
L[i] = L[i].replace(old, new, 1)
|
||||
elif i < len(L) and new in L[i]:
|
||||
pass
|
||||
else:
|
||||
ok = False
|
||||
print(f"MISS {ln}: {old!r} got {L[i].strip() if i < len(L) else '<oob>'!r}")
|
||||
|
||||
|
||||
edit(2009, "if (var1.size() >= ", "if (var1f.size() >= ")
|
||||
edit(1986, "var5 = var1.iterator();", "var5 = var1f.iterator();")
|
||||
edit(1967, "var1.add(chip(var3x));", "var1f.add(chip(var3x));")
|
||||
# insert before 1945
|
||||
if not any("final List var1f = var1;" in x for x in L[1940:1946]):
|
||||
L.insert(1944, " final List var1f = var1;")
|
||||
|
||||
open(p, "w", encoding="utf-8").write("\n".join(L) + "\n")
|
||||
print("OK" if ok else "PROBLEMS")
|
||||
sys.exit(0 if ok else 1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue