From 3c20d49c4a41067ab060bd563a3e6a205058cf51 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 18 Oct 2026 13:47:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(symbol):=20=E6=B3=9B=E5=9E=8B=E5=AE=9E?= =?UTF-8?q?=E5=8F=82=E5=BD=92=E4=B8=80=E4=BB=85=E8=AF=86=E5=88=AB=E5=86=85?= =?UTF-8?q?=E5=BB=BA=E7=9F=AD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CInt/CInt32T/CFloat/CFloat64T 等 C 类型类名不再归一,按原名返回;仅内建短名归一为 int。 --- lib/core/SymbolUtils.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/lib/core/SymbolUtils.py b/lib/core/SymbolUtils.py index e72be44..7357880 100644 --- a/lib/core/SymbolUtils.py +++ b/lib/core/SymbolUtils.py @@ -2713,16 +2713,6 @@ def IsPtrSubscriptNode(node: ast.AST, symtable: object | None = None, _GENERIC_ARG_INT_NAMES: frozenset[str] = frozenset({ - 'CInt', 'CChar', 'CShort', 'CLong', 'CLongLong', - 'CUnsigned', 'CUnsignedChar', 'CUnsignedInt', 'CUnsignedShort', - 'CUnsignedLong', 'CUnsignedLongLong', 'CSignedChar', 'CBool', - 'CInt8T', 'CInt16T', 'CInt32T', 'CInt64T', - 'CUInt8T', 'CUInt16T', 'CUInt32T', 'CUInt64T', - 'CIntFast8T', 'CIntFast16T', 'CIntFast32T', 'CIntFast64T', - 'CUIntFast8T', 'CUIntFast16T', 'CUIntFast32T', 'CUIntFast64T', - 'CIntLeast8T', 'CIntLeast16T', 'CIntLeast32T', 'CIntLeast64T', - 'CUIntLeast8T', 'CUIntLeast16T', 'CUIntLeast32T', 'CUIntLeast64T', - 'CSizeT', 'CIntPtrT', 'CUIntPtrT', 'CPtrDiffT', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'intfast8', 'intfast16', 'intfast32', 'intfast64', @@ -2733,17 +2723,9 @@ _GENERIC_ARG_INT_NAMES: frozenset[str] = frozenset({ 'long', 'ulong', 'longlong', 'ulonglong', 'ptrdifft', }) -_GENERIC_ARG_FLOAT_NAMES: frozenset[str] = frozenset({ - 'CFloat', 'CDouble', 'CFloat8T', 'CFloat16T', - 'CFloat32T', 'CFloat64T', 'CFloat128T', -}) - - def NormalizeGenericArgName(NameId: str) -> str: - """ast.Name 泛型实参 → 定义端 type_arg(HandlesExprCall._resolve_generic_slice_type - 的 ast.Name 分支,逐分支同构): - int/double/float 保留源码名('list[int]' 而非 'list[i32]')、 - char/bool → 'i8'、C 整数族 → 'int'、C 浮点族 → 'double'、其余原名。 + """泛型实参名归一:int/double/float 保留,char/bool → 'i8', + 内建整数短名 → 'int',其余原样返回。 """ if NameId in ('int', 'double', 'float'): return NameId @@ -2751,8 +2733,6 @@ def NormalizeGenericArgName(NameId: str) -> str: return 'i8' if NameId in _GENERIC_ARG_INT_NAMES: return 'int' - if NameId in _GENERIC_ARG_FLOAT_NAMES: - return 'double' return NameId