🐛 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:
@@ -1,10 +1,5 @@
|
||||
# TSL 调试与性能分析器
|
||||
|
||||
文档类型:语法主线
|
||||
是否可直接用于生成代码:仅部分
|
||||
是否含可直接照写示例:是
|
||||
是否含不可照写反例:是
|
||||
|
||||
这一篇收拢本页明确的调试、计时、性能分析器和调用栈相关入口。
|
||||
|
||||
## 本篇职责
|
||||
@@ -116,7 +111,7 @@ end;
|
||||
结果说明:
|
||||
|
||||
- 只输出 `before`
|
||||
- 说明 `debugReturn bb;` 不只是结束 `Inner(...)`,而是直接让整段脚本提前返回
|
||||
- 说明 `debugReturn value;` 不只是结束 `Inner(...)`,而是直接让整段脚本提前返回
|
||||
- 因此 `Inner(3)` 后面的 `writeLn("after")` 不会执行
|
||||
|
||||
### `debugRunEnv` 与 `debugRunEnvDo`
|
||||
@@ -215,8 +210,8 @@ writeLn(line_number);
|
||||
|
||||
结果说明:
|
||||
|
||||
- 输出 `3`
|
||||
- 说明 `__line__` 直接返回所在代码行号
|
||||
- 输出 `1`
|
||||
- 说明 `__line__` 直接返回它所在的代码行号(这里 `__line__` 在脚本第 1 行)
|
||||
|
||||
`__stack_frame`:
|
||||
|
||||
@@ -242,12 +237,12 @@ end;
|
||||
|
||||
```text
|
||||
array(
|
||||
(11,"__main__"),
|
||||
(8,"Outer"))
|
||||
(1,"__main__"),
|
||||
(10,"Outer"))
|
||||
```
|
||||
|
||||
- 说明 `__stack_frame` 返回的是调用栈帧数组
|
||||
- 在这个最小例子里,可以直接看到调用位置行号和调用者函数名
|
||||
- 在这个最小例子里,可以直接看到调用位置行号和调用者函数名:`__main__` 在第 1 行调用 `Outer()`,`Outer` 在第 10 行调用 `Inner()`
|
||||
|
||||
## 禁止项
|
||||
|
||||
|
||||
Reference in New Issue
Block a user