Addons: Renamed classStart/classEnd to match SymbolDatabase

This commit is contained in:
Daniel Marjamäki 2018-04-28 23:06:54 +02:00
parent 975be66c63
commit 2f18fbabaa
3 changed files with 14 additions and 15 deletions

View File

@ -38,7 +38,7 @@ def isUnpackedStruct(token):
return False; return False;
if token.valueType.typeScope.type != "Struct": if token.valueType.typeScope.type != "Struct":
return False return False
startToken = token.valueType.typeScope.classStart startToken = token.valueType.typeScope.bodyStart
linenr = int(startToken.linenr) linenr = int(startToken.linenr)
for line in open(startToken.file): for line in open(startToken.file):

View File

@ -268,8 +268,8 @@ class Scope:
C++ class: http://cppcheck.net/devinfo/doxyoutput/classScope.html C++ class: http://cppcheck.net/devinfo/doxyoutput/classScope.html
Attributes Attributes
classStart The { Token for this scope bodyStart The { Token for this scope
classEnd The } Token for this scope bodyEnd The } Token for this scope
className Name of this scope. className Name of this scope.
For a function scope, this is the function name; For a function scope, this is the function name;
For a class scope, this is the class name. For a class scope, this is the class name.
@ -277,11 +277,10 @@ class Scope:
""" """
Id = None Id = None
classStartId = None bodyStartId = None
bodyStart = None
classStart = None bodyEndId = None
classEndId = None bodyEnd = None
classEnd = None
className = None className = None
nestedInId = None nestedInId = None
nestedIn = None nestedIn = None
@ -290,17 +289,17 @@ class Scope:
def __init__(self, element): def __init__(self, element):
self.Id = element.get('id') self.Id = element.get('id')
self.className = element.get('className') self.className = element.get('className')
self.classStartId = element.get('classStart') self.bodyStartId = element.get('bodyStart')
self.classStart = None self.bodyStart = None
self.classEndId = element.get('classEnd') self.bodyEndId = element.get('bodyEnd')
self.classEnd = None self.bodyEnd = None
self.nestedInId = element.get('nestedIn') self.nestedInId = element.get('nestedIn')
self.nestedIn = None self.nestedIn = None
self.type = element.get('type') self.type = element.get('type')
def setId(self, IdMap): def setId(self, IdMap):
self.classStart = IdMap[self.classStartId] self.bodyStart = IdMap[self.bodyStartId]
self.classEnd = IdMap[self.classEndId] self.bodyEnd = IdMap[self.bodyEndId]
self.nestedIn = IdMap[self.nestedInId] self.nestedIn = IdMap[self.nestedInId]

View File

@ -44,4 +44,4 @@ for arg in sys.argv[1:]:
res = re.match(RE_FUNCTIONNAME, scope.className) res = re.match(RE_FUNCTIONNAME, scope.className)
if not res: if not res:
reportError( reportError(
scope.classStart, 'style', 'Function ' + scope.className + ' violates naming convention') scope.bodyStart, 'style', 'Function ' + scope.className + ' violates naming convention')