参考所有分组,完成尽量多的内容

结论:source-map纳入WASM-safe core和blocked源清单,并由聚合守护比对linuxcnc-rs274-wasm-source-files.txt,防止WASM源码链接文档与manifest漂移。
This commit is contained in:
cnc
2026-06-04 06:11:41 +08:00
parent 002c8a2d53
commit f9ac38251b
2 changed files with 94 additions and 0 deletions

View File

@@ -843,27 +843,65 @@ manifest_bindings = [
for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("binding:")
]
wasm_manifest_core = [
line.split(":", 2)[1]
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("core:")
]
wasm_manifest_blocked = [
line.split(":", 2)[1]
for line in Path("linuxcnc-rs274-wasm-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("blocked:")
]
source_map_core = []
source_map_bindings = []
source_map_wasm_core = []
source_map_wasm_blocked = []
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
for line in source_map.splitlines():
if line == "### Interpreter core":
in_core_section = True
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = False
continue
if line == "### Python binding modules":
in_core_section = False
in_binding_section = True
in_wasm_core_section = False
in_wasm_blocked_section = False
continue
if line == "### WASM-safe source core":
in_core_section = False
in_binding_section = False
in_wasm_core_section = True
in_wasm_blocked_section = False
continue
if line == "### WASM-blocked sources":
in_core_section = False
in_binding_section = False
in_wasm_core_section = False
in_wasm_blocked_section = True
continue
if in_core_section and line.startswith("### "):
break
if in_binding_section and line.startswith("### "):
in_binding_section = False
if in_wasm_core_section and line.startswith("### "):
in_wasm_core_section = False
if in_wasm_blocked_section and line.startswith("### "):
in_wasm_blocked_section = False
if in_core_section and line.startswith("- `"):
source_map_core.append(line.split("`", 2)[1])
if in_binding_section and line.startswith("- `"):
source_map_bindings.append(line.split("`", 2)[1])
if in_wasm_core_section and line.startswith("- `"):
source_map_wasm_core.append(line.split("`", 2)[1])
if in_wasm_blocked_section and line.startswith("- `"):
source_map_wasm_blocked.append(line.split("`", 2)[1])
if source_map_core != manifest_core:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md interpreter core list no longer matches linuxcnc-rs274-source-files.txt core manifest"
@@ -872,6 +910,14 @@ if source_map_bindings != manifest_bindings:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md Python binding module list no longer matches linuxcnc-rs274-source-files.txt binding manifest"
)
if source_map_wasm_core != wasm_manifest_core:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM-safe source core list no longer matches linuxcnc-rs274-wasm-source-files.txt core manifest"
)
if source_map_wasm_blocked != wasm_manifest_blocked:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md WASM-blocked source list no longer matches linuxcnc-rs274-wasm-source-files.txt blocked manifest"
)
PY
for script in \