Fix a regression introduced in latest bug fixes and fix some indentation and comments.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2694 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2008-06-15 17:50:07 +00:00
parent abf984d690
commit bdac40d369
2 changed files with 37 additions and 34 deletions

View File

@ -1,3 +1,10 @@
2008-06-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/python.c:
Fix a regression introduced in latest bug fixes and fix some
indentation and comments.
2008-06-11 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2008-06-11 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/python.c: * tagmanager/python.c:
@ -8,7 +15,7 @@
Create Makefiles for src, tagmanager and scintilla sub directories Create Makefiles for src, tagmanager and scintilla sub directories
to be able to run make from within Geany. to be able to run make from within Geany.
* scintilla/scintilla-marshal.c: * scintilla/scintilla-marshal.c:
Updated generated marschal code for Scintilla. Updated generated marshal code for Scintilla.
2008-06-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2008-06-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -180,15 +180,15 @@ static const char *skipEverything (const char *cp)
{ {
for (; *cp; cp++) for (; *cp; cp++)
{ {
if (*cp == '"' || *cp == '\'') if (*cp == '"' || *cp == '\'')
{ {
cp = skipString(cp); cp = skipString(cp);
if (!*cp) break; if (!*cp) break;
} }
if (isIdentifierFirstCharacter ((int) *cp)) if (isIdentifierFirstCharacter ((int) *cp))
return cp; return cp;
} }
return cp; return cp;
} }
/* Skip an identifier. */ /* Skip an identifier. */
@ -196,7 +196,7 @@ static const char *skipIdentifier (const char *cp)
{ {
while (isIdentifierCharacter ((int) *cp)) while (isIdentifierCharacter ((int) *cp))
cp++; cp++;
return cp; return cp;
} }
static const char *findDefinitionOrClass (const char *cp) static const char *findDefinitionOrClass (const char *cp)
@ -383,27 +383,27 @@ static void addNestingLevel(NestingLevels *nls, int indentation,
*/ */
static char const *find_triple_start(char const *string, char const **which) static char const *find_triple_start(char const *string, char const **which)
{ {
char const *cp = string; char const *cp = string;
for (; *cp; cp++) for (; *cp; cp++)
{ {
if (*cp == '"' || *cp == '\'') if (*cp == '"' || *cp == '\'')
{ {
if (strcmp(cp, doubletriple) == 0) if (strncmp(cp, doubletriple, 3) == 0)
{ {
*which = doubletriple; *which = doubletriple;
return cp; return cp;
} }
if (strcmp(cp, singletriple) == 0) if (strncmp(cp, singletriple, 3) == 0)
{ {
*which = singletriple; *which = singletriple;
return cp; return cp;
} }
cp = skipString(cp); cp = skipString(cp);
if (!*cp) break; if (!*cp) break;
} }
} }
return NULL; return NULL;
} }
/* Find the end of a triple string as pointed to by "which", and update "which" /* Find the end of a triple string as pointed to by "which", and update "which"
@ -411,11 +411,11 @@ static char const *find_triple_start(char const *string, char const **which)
*/ */
static void find_triple_end(char const *string, char const **which) static void find_triple_end(char const *string, char const **which)
{ {
char const *s = string; char const *s = string;
while (1) while (1)
{ {
/* Check if the string ends in the same line. */ /* Check if the string ends in the same line. */
s = strstr (s, *which); s = strstr (s, *which);
if (!s) break; if (!s) break;
s += 3; s += 3;
*which = NULL; *which = NULL;
@ -435,7 +435,7 @@ static const char *findVariable(const char *line)
const char *cp, *sp, *eq, *start; const char *cp, *sp, *eq, *start;
cp = strstr(line, "="); cp = strstr(line, "=");
if (! cp) if (!cp)
return NULL; return NULL;
eq = cp + 1; eq = cp + 1;
while (*eq) while (*eq)
@ -480,8 +480,8 @@ static void findPythonTags (void)
while ((line = (const char *) fileReadLine ()) != NULL) while ((line = (const char *) fileReadLine ()) != NULL)
{ {
const char *cp = line; const char *cp = line;
char *longstring; char const *longstring;
const char *keyword, *variable; char const *keyword, *variable;
int indent; int indent;
cp = skipSpace (cp); cp = skipSpace (cp);
@ -489,7 +489,7 @@ static void findPythonTags (void)
if (*cp == '\0') /* skip blank line */ if (*cp == '\0') /* skip blank line */
continue; continue;
/* Skip comment if we are not inside a multi-line string */ /* Skip comment if we are not inside a multi-line string. */
if (*cp == '#' && !longStringLiteral) if (*cp == '#' && !longStringLiteral)
continue; continue;
@ -514,7 +514,7 @@ static void findPythonTags (void)
/* Deal with multiline string ending. */ /* Deal with multiline string ending. */
if (longStringLiteral) if (longStringLiteral)
{ {
find_triple_end(cp, &longStringLiteral); find_triple_end(cp, &longStringLiteral);
continue; continue;
} }
@ -522,14 +522,10 @@ static void findPythonTags (void)
longstring = find_triple_start(cp, &longStringLiteral); longstring = find_triple_start(cp, &longStringLiteral);
if (longstring) if (longstring)
{ {
/* Note: For our purposes, the line just ends at the first long
* string. I.e. we don't parse for any tags in the rest of the
* line, but we do look for the string ending of course.
*/
*longstring = '\0';
longstring += 3; longstring += 3;
find_triple_end(longstring, &longStringLiteral); find_triple_end(longstring, &longStringLiteral);
/* We don't parse for any tags in the rest of the line. */
continue;
} }
/* Deal with def and class keywords. */ /* Deal with def and class keywords. */