🐛 fix(tsl_syntax): repair lookup engine and reconcile reference facts

lookup.py: exempt code-anchored ASCII identifiers from the mixed
zh/en gate so exact hits are no longer dropped; dedup parent/child
sections in results; validate write-prelude anchors in --check.

references: correct interpreter-verified facts (case-as-expression,
control-flow semicolons, __line__/__stack_frame, tslObjects order,
destroy timing, ErrDefine, truncated outputs), fix headings, scope
qualifiers and reversed quotes; strip dead preamble metadata from all
24 pages.

packaging: exclude __pycache__/*.pyc from playbook and bundle copies;
update build test file-count assertion to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
csh
2026-07-13 09:16:57 +08:00
co-authored by Claude Fable 5
parent 923bce91b0
commit b597edfc70
29 changed files with 356 additions and 256 deletions
@@ -1,10 +1,5 @@
# TSL 外部调用与线程
文档类型:语法深水专题
是否可直接用于生成代码:仅部分
是否含可直接照写示例:是
是否含不可照写反例:是
这一篇吸收函数专题里和外部系统交互有关的部分:`external`、动态库调用、原生函数指针包装、C 回调和线程调用。
## 本篇职责
@@ -59,6 +54,7 @@ function Tick64Alias(): int64; stdcall; external "kernel32.dll" name "GetTickCou
Linux / POSIX 环境的同类最小骨架:
代码块身份:可直接照写示例
代码块说明:仅类 Unix 环境可执行(依赖 `libc.so.6`);Windows 下不可照抄,本块只演示 `.so` 库名写法。
```tsl
writeLn(getpid() > 0);
@@ -171,7 +167,7 @@ end;
结果说明:
- 输出 `1`
- 说明类常量字符串可以用于 `external kernel_dll` 这种 DLL 名位置
- 说明类常量字符串(如 `kKernelDll`可以用于 `external kKernelDll` 这种 DLL 名位置
不作为可写事实边界:
@@ -201,8 +197,8 @@ end;
结果说明:
- `fp <> nil` 输出 `1`
- `##f(3, 4)` 输出 `7`
- `func_ptr <> nil` 输出 `1`
- `##wrapped_func(3, 4)` 输出 `7`
- 说明 `makeInstance(...)` 生成的函数指针可以再通过 `function(...); external fp;` 包装回 TSL 侧调用
### 线程模式最小正例