Revision: 3785 http://geany.svn.sourceforge.net/geany/?rev=3785&view=rev Author: ntrel Date: 2009-05-12 14:59:29 +0000 (Tue, 12 May 2009)
Log Message: ----------- Remove NestingLevel::is_class field, use ::type instead. Move addNestingLevel() back to python.c.
Modified Paths: -------------- branches/unstable/ChangeLog branches/unstable/tagmanager/nestlevel.c branches/unstable/tagmanager/nestlevel.h branches/unstable/tagmanager/python.c
Modified: branches/unstable/ChangeLog =================================================================== --- branches/unstable/ChangeLog 2009-05-11 18:06:52 UTC (rev 3784) +++ branches/unstable/ChangeLog 2009-05-12 14:59:29 UTC (rev 3785) @@ -1,3 +1,10 @@ +2009-05-12 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * tagmanager/nestlevel.c, tagmanager/nestlevel.h, tagmanager/python.c: + Remove NestingLevel::is_class field, use ::type instead. + Move addNestingLevel() back to python.c. + + 2009-05-11 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* tagmanager/makefile.win32, tagmanager/nestlevel.c,
Modified: branches/unstable/tagmanager/nestlevel.c =================================================================== --- branches/unstable/tagmanager/nestlevel.c 2009-05-11 18:06:52 UTC (rev 3784) +++ branches/unstable/tagmanager/nestlevel.c 2009-05-12 14:59:29 UTC (rev 3785) @@ -37,36 +37,6 @@ eFree(nls); }
-/* currently only for indentation langs e.g. python */ -extern void addNestingLevel(NestingLevels *nls, int indentation, - const vString *name, boolean is_class) -{ - int i; - NestingLevel *nl = NULL; - - for (i = 0; i < nls->n; i++) - { - nl = nls->levels + i; - if (indentation <= nl->indentation) break; - } - if (i == nls->n) - { - if (i >= nls->allocated) - { - nls->allocated++; - nls->levels = xRealloc(nls->levels, - nls->allocated, NestingLevel); - nls->levels[i].name = vStringNew(); - } - nl = nls->levels + i; - } - nls->n = i + 1; - - vStringCopy(nl->name, name); - nl->indentation = indentation; - nl->is_class = is_class; -} - extern void nestingLevelsPush(NestingLevels *nls, const vString *name, int type) {
Modified: branches/unstable/tagmanager/nestlevel.h =================================================================== --- branches/unstable/tagmanager/nestlevel.h 2009-05-11 18:06:52 UTC (rev 3784) +++ branches/unstable/tagmanager/nestlevel.h 2009-05-12 14:59:29 UTC (rev 3785) @@ -30,7 +30,6 @@ int indentation; vString *name; int type; - boolean is_class; /* should be replaced by type field */ };
struct NestingLevels @@ -45,8 +44,6 @@ */ extern NestingLevels *newNestingLevels(void); extern void freeNestingLevels(NestingLevels *nls); -extern void addNestingLevel(NestingLevels *nls, int indentation, - const vString *name, boolean is_class); extern void nestingLevelsPush(NestingLevels *nls, const vString *name, int type); extern void nestingLevelsPop(NestingLevels *nls);
Modified: branches/unstable/tagmanager/python.c =================================================================== --- branches/unstable/tagmanager/python.c 2009-05-11 18:06:52 UTC (rev 3784) +++ branches/unstable/tagmanager/python.c 2009-05-12 14:59:29 UTC (rev 3785) @@ -278,13 +278,13 @@ break; if (prev) { - if (prev->is_class) + if (prev->type == K_CLASS) vStringCatS(result, "."); else vStringCatS(result, "/"); } vStringCat(result, nl->name); - is_class = nl->is_class; + is_class = (nl->type == K_CLASS); prev = nl; } return is_class; @@ -314,6 +314,35 @@ } }
+static void addNestingLevel(NestingLevels *nls, int indentation, + const vString *name, boolean is_class) +{ + int i; + NestingLevel *nl = NULL; + + for (i = 0; i < nls->n; i++) + { + nl = nls->levels + i; + if (indentation <= nl->indentation) break; + } + if (i == nls->n) + { + if (i >= nls->allocated) + { + nls->allocated++; + nls->levels = xRealloc(nls->levels, + nls->allocated, NestingLevel); + nls->levels[i].name = vStringNew(); + } + nl = nls->levels + i; + } + nls->n = i + 1; + + vStringCopy(nl->name, name); + nl->indentation = indentation; + nl->type = is_class ? K_CLASS : !K_CLASS; +} + /* Return a pointer to the start of the next triple string, or NULL. Store * the kind of triple string in "which" if the return is not NULL. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.