cppcheckdata: Set Function.nestedIn attribute

This commit is contained in:
Daniel Marjamäki 2020-04-16 12:14:29 +02:00
parent e4bea02cad
commit 75a369d217
1 changed files with 4 additions and 2 deletions

View File

@ -392,8 +392,9 @@ class Function:
isVirtual = None
isImplicitlyVirtual = None
isStatic = None
nestedIn = None
def __init__(self, element):
def __init__(self, element, nestedIn):
self.Id = element.get('id')
self.tokenDefId = element.get('tokenDef')
self.name = element.get('name')
@ -404,6 +405,7 @@ class Function:
self.isImplicitlyVirtual = (isImplicitlyVirtual and isImplicitlyVirtual == 'true')
isStatic = element.get('isStatic')
self.isStatic = (isStatic and isStatic == 'true')
self.nestedIn = nestedIn
self.argument = {}
self.argumentId = {}
@ -940,7 +942,7 @@ class CppcheckData:
continue
elif node.tag == 'function':
if event == 'start':
cfg_function = Function(node)
cfg_function = Function(node, cfg.scopes[-1])
continue
elif event == 'end':
cfg.functions.append(cfg_function)