fix(sizeof,parse): 尺寸链去静默兜底,解析报错可定位,补 C 解析器缺口
StructGen: _get_struct_size/_get_align 去 opaque→8/ptr_size、未知→4 兜底并补 VectorType;LiteralStructType.fields→.elements(llvmlite 无 fields,必然 AttributeError) HandlesClassDef: union 载荷尺寸经不存在的 ir.DataLayout 静默退化成 8 字节;HandlesExprCall/ExprBuiltin: sizeof 各静默 0 分支改 fail-fast,数组元素 sizeof 统一走 _get_struct_size HandlesFor: nonlocal struct/array 堆分配不再退化成 malloc(8) vast/vast_c: 补一元 * / & 解析,装饰器后 extern/export 分派修复,C 侧报错带 token 与行号;StubGen.Converter: 宏展开丢尾随空行修 .pyi 缩进非法 其余为 rawptr 迁移 / fail-fast 口径等历史改动一并入库
This commit is contained in:
1 parent
53a345a59a
commit
c83fc752c6
53 files changed
+6238
-887
No files matched your search
@@ -198,7 +198,7 @@ class AnnotationLoaderMixin:
|
||||
with open(ModuleName, 'r', encoding='utf-8') as f:
|
||||
ann_content: str = f.read()
|
||||
ann_content = ExpandSoftKeywords(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content, ModuleName)
|
||||
for node in ann_tree.body:
|
||||
if isinstance(node, ast.ClassDef):
|
||||
ClassName: str = node.name
|
||||
@@ -239,7 +239,7 @@ class AnnotationLoaderMixin:
|
||||
with open(ModuleName, 'r', encoding='utf-8') as f:
|
||||
ann_content: str = f.read()
|
||||
ann_content = ExpandSoftKeywords(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content, ModuleName)
|
||||
for node in ann_tree.body:
|
||||
# 检测 xxx: t.CEnum 形式的枚举成员变量
|
||||
if isinstance(node, ast.AnnAssign):
|
||||
@@ -286,7 +286,7 @@ class AnnotationLoaderMixin:
|
||||
with open(ModuleName, 'r', encoding='utf-8') as f:
|
||||
ann_content: str = f.read()
|
||||
ann_content = ExpandSoftKeywords(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content)
|
||||
ann_tree: ast.Module = ast.parse(ann_content, ModuleName)
|
||||
for node in ann_tree.body:
|
||||
# 检测 xxx: t.CTypedef = xxx 形式的 typedef 语句
|
||||
if isinstance(node, ast.AnnAssign):
|
||||
|
||||
Reference in new issue
Block a user