将 EnumName/value/IsSigned 加入 FIELD_ROUTES,消除所有冗余 hasattr/getattr

This commit is contained in:
2026-06-18 19:09:50 +08:00
parent f99666420b
commit d7b98cc9c5
33 changed files with 1722 additions and 1200 deletions

View File

@@ -328,9 +328,9 @@ class AnnotationLoaderMixin:
orig_type_str = orig_entry.get('OriginalType', f'struct {original_name}')
elif orig_entry.get('type') == 'enum':
orig_type_str = f'enum {original_name}'
elif hasattr(orig_entry, 'IsTypedef') and orig_entry.IsTypedef:
orig_type_str = getattr(orig_entry, 'OriginalType', f'struct {original_name}')
elif hasattr(orig_entry, 'IsEnum') and orig_entry.IsEnum:
elif orig_entry.IsTypedef:
orig_type_str = orig_entry.OriginalType or f'struct {original_name}'
elif orig_entry.IsEnum:
orig_type_str = f'enum {original_name}'
TypedefNode.OriginalType = orig_type_str
TypedefNode.set('source', 'annotation_module')