refactor(tpc): 退役 t/c 模块并将定宽类型升级为内建

删除 lib/includes/t.py、c.py,类型模型迁入 lib/core/TypeSystem.py;移除 IsTModule/_T_MODULE_NAMES 等名称判据,语法糖与内部标记统一为裸名;builtins 的 sizet/intN/uintN/fast/least/uchar/short/long 等改为编译器内建短名。
This commit is contained in:
TermiNexus committed 2026-10-18 13:00:58 +08:00
1 parent 8d27747c7c
commit f19d25782f
66 files changed
+2445 -3638

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ _FILE_AST_CACHE: dict[str, tuple[float, str, ast.Module]] = {}
def _check_annotation_for_export(annotation: ast.AST | None) -> bool:
"""递归检查类型注解中是否包含 CExport/CExtern/State(t.State = t.CExtern | t.CExport)"""
"""递归检查类型注解中是否包含 CExport/CExtern/State(State = CExtern | CExport)"""
if not annotation:
return False
return (AnnotationContainsName(annotation, 'CExport') or
@@ -78,7 +78,7 @@ def parse_python_file(filepath: str) -> tuple[str, ast.Module] | tuple[str, None
except Exception:
return ('', None)
try:
# 软关键字/语法糖展开:fn/fun/func/function -> def、enum 块 -> class X(t.CEnum)
# 软关键字/语法糖展开:fn/fun/func/function -> def、enum 块 -> class X(CEnum)
# (均同行替换,行号不变),供 ast.parse 使用。
# 注意 content 保持原始文本返回(compute_sha1 必须与 Phase1 一致),
# 仅 tree 基于展开后的代码解析。