From 75a369d217026fdecba10f60fdb2206e7976f519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 16 Apr 2020 12:14:29 +0200 Subject: [PATCH] cppcheckdata: Set Function.nestedIn attribute --- addons/cppcheckdata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index b1ea4d762..b9e14ef7c 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -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)