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:
parent
66396e7ca7
commit
e6878e5cbf
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user