addons/cppcheckdata.py: Add 'cppcheckdata.getArguments' function
This commit is contained in:
parent
1b4485a738
commit
63bd29d644
|
@ -757,6 +757,25 @@ class CppcheckData:
|
||||||
self.configurations.append(Configuration(cfgnode))
|
self.configurations.append(Configuration(cfgnode))
|
||||||
|
|
||||||
|
|
||||||
|
# Get function arguments
|
||||||
|
def getArgumentsRecursive(tok, arguments):
|
||||||
|
if tok is None:
|
||||||
|
return
|
||||||
|
if tok.str == ',':
|
||||||
|
getArgumentsRecursive(tok.astOperand1, arguments)
|
||||||
|
getArgumentsRecursive(tok.astOperand2, arguments)
|
||||||
|
else:
|
||||||
|
arguments.append(tok)
|
||||||
|
|
||||||
|
|
||||||
|
def getArguments(ftok):
|
||||||
|
if (not ftok.isName) or (ftok.next is None) or ftok.next.str != '(':
|
||||||
|
return None
|
||||||
|
args = []
|
||||||
|
getArgumentsRecursive(ftok.next.astOperand2, args)
|
||||||
|
return args
|
||||||
|
|
||||||
|
|
||||||
def parsedump(filename):
|
def parsedump(filename):
|
||||||
"""
|
"""
|
||||||
parse a cppcheck dump file
|
parse a cppcheck dump file
|
||||||
|
|
Loading…
Reference in New Issue