mirror of
https://github.com/python/cpython.git
synced 2025-11-10 18:42:04 +00:00
gh-90110: Update the c-analyzer Tool (gh-96058)
This commit is contained in:
parent
5aac85101b
commit
586fc02be5
4 changed files with 87 additions and 8 deletions
|
|
@ -385,6 +385,9 @@ def get_parsed_vartype(decl):
|
|||
elif isinstance(decl, Variable):
|
||||
storage = decl.storage
|
||||
typequal, typespec, abstract = decl.vartype
|
||||
elif isinstance(decl, Signature):
|
||||
storage = None
|
||||
typequal, typespec, abstract = decl.returntype
|
||||
elif isinstance(decl, Function):
|
||||
storage = decl.storage
|
||||
typequal, typespec, abstract = decl.signature.returntype
|
||||
|
|
@ -1012,6 +1015,18 @@ def __str__(self):
|
|||
def returns(self):
|
||||
return self.returntype
|
||||
|
||||
@property
|
||||
def typequal(self):
|
||||
return self.returntype.typequal
|
||||
|
||||
@property
|
||||
def typespec(self):
|
||||
return self.returntype.typespec
|
||||
|
||||
@property
|
||||
def abstract(self):
|
||||
return self.returntype.abstract
|
||||
|
||||
|
||||
class Function(Declaration):
|
||||
kind = KIND.FUNCTION
|
||||
|
|
@ -1106,9 +1121,16 @@ class TypeDef(TypeDeclaration):
|
|||
def _resolve_data(cls, data):
|
||||
if not data:
|
||||
raise NotImplementedError(data)
|
||||
vartype = dict(data)
|
||||
del vartype['storage']
|
||||
return VarType(**vartype), None
|
||||
kwargs = dict(data)
|
||||
del kwargs['storage']
|
||||
if 'returntype' in kwargs:
|
||||
vartype = kwargs['returntype']
|
||||
del vartype['storage']
|
||||
kwargs['returntype'] = VarType(**vartype)
|
||||
datacls = Signature
|
||||
else:
|
||||
datacls = VarType
|
||||
return datacls(**kwargs), None
|
||||
|
||||
@classmethod
|
||||
def _raw_data(self, data):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue