feat(tpv): App 与 TPVAppBK 新代版本对齐(rowptr 配套实现全套)
把 TransPyV/App 覆盖为 TPVAppBK 内容(39 文件):6 参注册式 _BuildReachableSha1Set 全套(StubMergerBuild/Store/Collect/__init__/IncludesScanner/Phase1Scan 等)、CallGen 与 TypeGenResolve 等新代实现。配套根 includes 为 rowptr 工作区(另有 includes_rowptr_bk 备份)。
This commit is contained in:
1 parent
c35246f426
commit
6b368b46a7
39 files changed
+2813
-505
No files matched your search
@@ -374,6 +374,31 @@ def _FindClassDefSha1(class_names_buf: bytes, def_sha1s_buf: bytes,
|
||||
# 因此每个节点先递归其表达式承载字段,再递归 children 语句块。
|
||||
# 命中即置 need_list/need_dict;误报无害(最多多编译两个空壳模块)。
|
||||
# ============================================================
|
||||
|
||||
def _AnnIsContainer(ann: ast.AST | t.CPtr) -> int:
|
||||
"""注解是否为 list/dict 容器(Name 裸名或 Subscript list[...]/dict[...])
|
||||
|
||||
数组初始化(t.CArray[...] / 裸数组注解)返回 0,避免 _ScanTreeForContainers
|
||||
把数组字面量误判为 list 容器使用(FIX 2026-08-30,联动 Translator.vp 同修)。
|
||||
"""
|
||||
while ann is not None:
|
||||
ak_c: int = ann.kind()
|
||||
if ak_c == ast.ASTKind.Name:
|
||||
nm_c: ast.Name | t.CPtr = (ast.Name | t.CPtr)(ann)
|
||||
if nm_c.id is not None:
|
||||
if string.strcmp(nm_c.id, "list") == 0:
|
||||
return 1
|
||||
if string.strcmp(nm_c.id, "dict") == 0:
|
||||
return 1
|
||||
return 0
|
||||
elif ak_c == ast.ASTKind.Subscript:
|
||||
sub_c: ast.Subscript | t.CPtr = (ast.Subscript | t.CPtr)(ann)
|
||||
ann = sub_c.value
|
||||
else:
|
||||
return 0
|
||||
return 0
|
||||
|
||||
|
||||
def _ScanTreeForContainers(node: ast.AST | t.CPtr,
|
||||
need_list_box: t.CPtr,
|
||||
need_dict_box: t.CPtr,
|
||||
@@ -489,12 +514,14 @@ def _ScanTreeForContainers(node: ast.AST | t.CPtr,
|
||||
i_v2: t.CSizeT
|
||||
for i_v2 in range(nv_s):
|
||||
_ScanTreeForContainers(bvs_s.get(i_v2), need_list_box, need_dict_box, depth + 1)
|
||||
elif k_s == ast.ASTKind.List:
|
||||
# [] 字面量
|
||||
need_list_box[0] = 1
|
||||
elif k_s == ast.ASTKind.Dict:
|
||||
# {} 字面量
|
||||
need_dict_box[0] = 1
|
||||
# [FIX 2026-08-30] `[...]`/`{}` 字面量不再无条件触发 _list/_dict 导入:
|
||||
# 字面量广泛用于编译期常量列表(c.Asm 的 op/inp/out CLOBBER 参数、
|
||||
# 数组数据初始化),并非 list 容器使用。list/dict 容器的真实使用由
|
||||
# 类型位置检测覆盖(Name/Subscript 注解、Call.func 构造名)。
|
||||
# elif k_s == ast.ASTKind.List:
|
||||
# need_list_box[0] = 1
|
||||
# elif k_s == ast.ASTKind.Dict:
|
||||
# need_dict_box[0] = 1
|
||||
# 递归语句块子节点
|
||||
if node.children is not None:
|
||||
ch_s: list[ast.AST | t.CPtr] | t.CPtr = node.children
|
||||
|
||||
Reference in new issue
Block a user