Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Applied a patch (with minor modification) by Jan Larres to not includ…

…e tab characters in the signature of Python functions.
  • Loading branch information...
commit 19161294aa75820563a61422cacb5eb8eae40716 1 parent 7704abc
@elias-pschernig elias-pschernig authored
Showing with 20 additions and 2 deletions.
  1. +3 −0  Test/tabindent.py
  2. +17 −2 python.c
View
3  Test/tabindent.py
@@ -0,0 +1,3 @@
+def find_heading(self, position=0, direction=Direction.FORWARD, \
+ heading=Heading, connect_with_document=True):
+ pass
View
19 python.c
@@ -135,7 +135,7 @@ static boolean isIdentifierCharacter (int c)
* extract all relevant information and create a tag.
*/
static void makeFunctionTag (vString *const function,
- vString *const parent, int is_class_parent, const char *arglist __unused__)
+ vString *const parent, int is_class_parent, const char *arglist)
{
tagEntryInfo tag;
initTagEntry (&tag, vStringValue (function));
@@ -394,6 +394,8 @@ static char *parseArglist(const char *buf)
{
char *start, *end;
int level;
+ char *arglist, *from, *to;
+ int len;
if (NULL == buf)
return NULL;
if (NULL == (start = strchr(buf, '(')))
@@ -408,7 +410,20 @@ static char *parseArglist(const char *buf)
-- level;
}
*end = '\0';
- return strdup(start);
+
+ len = strlen(start) + 1;
+ arglist = eMalloc(len);
+ from = start;
+ to = arglist;
+ while (*from != '\0') {
+ if (*from == '\t')
+ ; /* tabs are illegal in field values */
+ else
+ *to++ = *from;
+ ++from;
+ }
+ *to = '\0';
+ return arglist;
}
static void parseFunction (const char *cp, vString *const def,
Please sign in to comment.
Something went wrong with that request. Please try again.