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;
if token.valueType.typeScope.type != "Struct":
return False
startToken = token.valueType.typeScope.classStart
startToken = token.valueType.typeScope.bodyStart
linenr = int(startToken.linenr)
for line in open(startToken.file):

View File

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

View File

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