Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
None
-
4099cef35db9c26add8ce8e6d5c4a95aaaa552ca
Description
in the following code:
main() { struct LARGE { in a; int b; int c }; QList<LARGE> test }
the extraction of the template argument using the API
def extractTemplateArgument(self, typename, position): (dymper.py)
will fail. This is because the data type is: QList<main(int, char**)::LARGE>
A possible correction,is that when () are used it is for function name only and everythong before the closing ')' can be discarded. The real name look-up will be done in the context of the current function (only possible case), and this name is not needed.
correction could be:
def extractTemplateArgument(self, typename, position): level = 0 skipSpace = False inner = '' semi = -1 for c in typename[typename.find('<') + 1 : -1]: if c == '<': inner += c level += 1 elif c == '>': level -= 1 inner += c elif c == ')': semi = 0 elif c == ':' and semi!=-1: semi += 1 if semi==2: inner = '' elif c == ',': if level == 0: if position == 0: return inner.strip() position -= 1 inner = '' else: inner += c skipSpace = True else: if skipSpace and c == ' ': pass else: inner += c skipSpace = False return inner.strip()