refactor(type): 全面清理旧联合与 t/c 标记判断
审计并修复 23 个文件:类型注解中的 T1 | T2 一律 fail-fast;typedef/define/export/extern/static/const/volatile/attribute 优先读取 Markers/Attributes/ByteOrder/BitWidth;指针统一 CPtr/rawptr/CRef/CTempRef/CArrayPtr/CAutoPtr Subscript;stub 输出统一新语法。
This commit is contained in:
1 parent
a410de2cf7
commit
0bded58999
23 files changed
+887
-694
No files matched your search
@@ -41,9 +41,16 @@ _FILE_AST_CACHE: dict[str, tuple[float, str, ast.Module]] = {}
|
||||
|
||||
|
||||
def _check_annotation_for_export(annotation: ast.AST | None) -> bool:
|
||||
"""递归检查类型注解中是否包含 CExport/CExtern/State(State = CExtern | CExport)"""
|
||||
"""检查类型注解是否带 export / extern / state。
|
||||
|
||||
优先读解析器写入的 Markers 字段(export/extern/state);旧的
|
||||
CExport/CExtern/State 文本判断仅作兼容回落。
|
||||
"""
|
||||
if not annotation:
|
||||
return False
|
||||
Markers: tuple[str, ...] = getattr(annotation, 'Markers', None) or ()
|
||||
if 'export' in Markers or 'extern' in Markers or 'state' in Markers:
|
||||
return True
|
||||
return (AnnotationContainsName(annotation, 'CExport') or
|
||||
AnnotationContainsName(annotation, 'CExtern') or
|
||||
AnnotationContainsName(annotation, 'State'))
|
||||
|
||||
Reference in new issue
Block a user