Fix ctags for complex Cython type declarations

Cython allows the use NumPy arrays on a C level. In that context, a
typical return type declaration could be e.g. "cpdef
numpy.ndarray[dtype=double, ndim=1] name". This now generates a tag for
the function. Previously, the equal sign prevented that.
This commit is contained in:
Alexander Eberspächer 2013-07-08 13:08:05 +02:00
parent 66396e7ca7
commit e6878e5cbf

View File

@ -576,7 +576,13 @@ static const char *skipTypeDecl (const char *cp, boolean *is_class)
}
/* limit so that we don't pick off "int item=obj()" */
while (*ptr && loopCount++ < 2) {
while (*ptr && *ptr != '=' && *ptr != '(' && !isspace(*ptr)) ptr++;
while (*ptr && *ptr != '=' && *ptr != '(' && !isspace(*ptr)) {
/* skip over e.g. 'cpdef numpy.ndarray[dtype=double, ndim=1]' */
if(*ptr == '[') {
while(*ptr && *ptr != ']') ptr++;
}
ptr++;
}
if (!*ptr || *ptr == '=') return NULL;
if (*ptr == '(') {
return lastStart; /* if we stopped on a '(' we are done */