fix(symbol): 补齐泛型实参归一使用的整数/浮点族名集合
NormalizeGenericArgName 引用的 _GENERIC_ARG_INT_NAMES / _GENERIC_ARG_FLOAT_NAMES 此前未定义,导致 NameError;补充 C 类型类名与内建短名。
This commit is contained in:
1 parent
e770e1964f
commit
5157ce2996
1 file changed
+27
@@ -2712,6 +2712,33 @@ def IsPtrSubscriptNode(node: ast.AST, symtable: object | None = None,
|
||||
return IsCPtrMarkerNode(value, symtable, TCAliasMap)
|
||||
|
||||
|
||||
_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',
|
||||
'uintfast8', 'uintfast16', 'uintfast32', 'uintfast64',
|
||||
'intleast8', 'intleast16', 'intleast32', 'intleast64',
|
||||
'uintleast8', 'uintleast16', 'uintleast32', 'uintleast64',
|
||||
'sizet', 'size_t', 'uchar', 'short', 'ushort', 'uint',
|
||||
'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 分支,逐分支同构):
|
||||
|
||||
Reference in new issue
Block a user