addons/naming.py: fixed error report for function name
This commit is contained in:
parent
8b8d898b96
commit
0e82730ee4
|
@ -171,10 +171,13 @@ class Function:
|
||||||
Id = None
|
Id = None
|
||||||
argument = None
|
argument = None
|
||||||
argumentId = None
|
argumentId = None
|
||||||
|
tokenDef = None
|
||||||
|
tokenDefId = None
|
||||||
name = None
|
name = None
|
||||||
|
|
||||||
def __init__(self, element):
|
def __init__(self, element):
|
||||||
self.Id = element.get('id')
|
self.Id = element.get('id')
|
||||||
|
self.tokenDefId = element.get('tokenDef')
|
||||||
self.name = element.get('name')
|
self.name = element.get('name')
|
||||||
self.argument = {}
|
self.argument = {}
|
||||||
self.argumentId = {}
|
self.argumentId = {}
|
||||||
|
@ -184,7 +187,7 @@ class Function:
|
||||||
def setId(self, IdMap):
|
def setId(self, IdMap):
|
||||||
for argnr, argid in self.argumentId.items():
|
for argnr, argid in self.argumentId.items():
|
||||||
self.argument[argnr] = IdMap[argid]
|
self.argument[argnr] = IdMap[argid]
|
||||||
|
self.tokenDef = IdMap[self.tokenDefId]
|
||||||
|
|
||||||
class Variable:
|
class Variable:
|
||||||
Id = None
|
Id = None
|
||||||
|
|
|
@ -30,4 +30,4 @@ for arg in sys.argv[1:]:
|
||||||
for function in data.functions:
|
for function in data.functions:
|
||||||
res = re.match(RE_FUNCTIONNAME, function.name)
|
res = re.match(RE_FUNCTIONNAME, function.name)
|
||||||
if not res:
|
if not res:
|
||||||
reportError(var.typeStartToken, 'style', 'Function ' + function.name + ' violates naming convention')
|
reportError(function.tokenDef, 'style', 'Function ' + function.name + ' violates naming convention')
|
||||||
|
|
|
@ -2471,7 +2471,7 @@ void SymbolDatabase::printXml(std::ostream &out) const
|
||||||
if (!scope->functionList.empty()) {
|
if (!scope->functionList.empty()) {
|
||||||
out << " <functionList>" << std::endl;
|
out << " <functionList>" << std::endl;
|
||||||
for (std::list<Function>::const_iterator function = scope->functionList.begin(); function != scope->functionList.end(); ++function) {
|
for (std::list<Function>::const_iterator function = scope->functionList.begin(); function != scope->functionList.end(); ++function) {
|
||||||
out << " <function id=\"" << &*function << "\" name=\"" << function->name() << '\"';
|
out << " <function id=\"" << &*function << "\" tokenDef=\"" << function->tokenDef << "\" name=\"" << function->name() << '\"';
|
||||||
if (function->argCount() == 0U)
|
if (function->argCount() == 0U)
|
||||||
out << "/>" << std::endl;
|
out << "/>" << std::endl;
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue