docs(includes): R11 注释英文化——75 个文件的中文注释改写为英文短注释
按规范「注释只讲解作用,不掺杂历史原因,尽量英文」:把 includes 下 75 个 .vp 的中文 # 注释与三引号 docstring 改写为英文,每个注释块压到 2 行以内。 保留要点:作用、约束、危险警告(不得/必须/注意)、ABI 与类型约定(如 BYTEPTR | t.CPtr = i8** 的跨模块坍缩坑)、位宽/长度约定、fail-fast 要求、内存与句柄所有权。 未动:文件头注释(规范豁免,仍是中文)、运行时中文字符串常量(printf / fatal_error / MlirFail 等用户可见消息,属代码字面量)。 验证:独立脚本比对 HEAD 与工作区的代码骨架(剥离 # 注释与三引号 docstring 后的非空行)——75 个文件逐字节一致;行尾 CRLF/LF 未被改动;全文剩余中文仅 547 行头注释、0 条行尾注释。bootstrap 三重重编 SUCCESS;全量 77/77 顺序回归通过。
This commit is contained in:
1 parent
27121f56a7
commit
e71daeea0e
75 files changed
+3040
-4214
No files matched your search
+4
-6
@@ -284,9 +284,8 @@ class ArgumentParser:
|
||||
arg: Argument* = None
|
||||
value: str = None
|
||||
|
||||
# argv 是 char**(`str | t.CPtr`),argv[idx] 直接给出该位置的 char*。
|
||||
# 不要写成 `str*(uint64(argv) + idx*8)`:那样右值是 i8**,TPC 的赋值路径
|
||||
# 会对"指针的指针"右值再解引用一次(多 load 一层)→ 取到野指针。
|
||||
# argv is char** (`str | t.CPtr`); argv[idx] directly gives the char* at that position.
|
||||
# Do NOT write `str*(uint64(argv) + idx*8)`: the right-hand side would be i8**, and TPC's assignment path dereferences a "pointer to pointer" rvalue one extra time (an extra load) -> a wild pointer.
|
||||
while idx < argc:
|
||||
token = argv[idx]
|
||||
if token is None:
|
||||
@@ -434,9 +433,8 @@ def release(args: rawptr[ParsedArgs]):
|
||||
if args is None: return
|
||||
if args.__mbuddy__ is None: return
|
||||
if args._ht is not None:
|
||||
# 用临时变量拆分链式属性访问,避免 args._ht.__slots__ 跨模块类型推断失败
|
||||
# 注意:类型注解必须用 hashtable.HashTable(带模块前缀),
|
||||
# 否则编译器无法解析 HashTable 类型,导致 ht.__slots__ 属性访问失败
|
||||
# Split the chained attribute access with a temp variable to avoid cross-module type inference failure for args._ht.__slots__.
|
||||
# Note: the type annotation must be hashtable.HashTable (module-prefixed), otherwise the compiler cannot resolve HashTable and ht.__slots__ access fails.
|
||||
ht: hashtable.HashTable* = args._ht
|
||||
if ht.__slots__ is not None:
|
||||
args.__mbuddy__.free(ht.__slots__)
|
||||
|
||||
Reference in new issue
Block a user