Revision: 2112 http://geany.svn.sourceforge.net/geany/?rev=2112&view=rev Author: ntrel Date: 2007-12-18 09:05:56 -0800 (Tue, 18 Dec 2007)
Log Message: ----------- Remove unused pointerOrder code from C parser, as it's not necessary since r1952, and not in the standard ctags code. Leaving it in the TagManager code however for backwards compatibility with global tag files.
Modified Paths: -------------- trunk/ChangeLog trunk/tagmanager/c.c trunk/tagmanager/entry.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-12-18 17:03:39 UTC (rev 2111) +++ trunk/ChangeLog 2007-12-18 17:05:56 UTC (rev 2112) @@ -18,6 +18,11 @@ Fix parsing C arrays (broken in r1952, oops). * src/keybindings.c: Don't flicker menubar when typing Shift-[a-z] in the VTE. + * tagmanager/entry.h, tagmanager/c.c: + Remove unused pointerOrder code from C parser, as it's not necessary + since r1952, and not in the standard ctags code. Leaving it in the + TagManager code however for backwards compatibility with global tag + files.
2007-12-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/tagmanager/c.c =================================================================== --- trunk/tagmanager/c.c 2007-12-18 17:03:39 UTC (rev 2111) +++ trunk/tagmanager/c.c 2007-12-18 17:05:56 UTC (rev 2112) @@ -168,13 +168,10 @@ tokenType type; keywordId keyword; vString* name; /* the name of the token */ - int pointerOrder; /* 0=no pointer, 1=pointer, 2=pointer - to pointer, etc */ unsigned long lineNumber; /* line number of tag */ fpos_t filePosition; /* file position of line containing name */ } tokenInfo;
- typedef enum eImplementation { IMP_DEFAULT, IMP_ABSTRACT, @@ -192,8 +189,6 @@ boolean haveQualifyingName; /* do we have a name we are considering? */ boolean gotParenName; /* was a name inside parentheses parsed yet? */ boolean gotArgs; /* was a list of parameters parsed yet? */ - int pointerOrder; /* 0=no pointer, 1=pointer, 2=pointer - to pointer, etc */ impType implementation; /* abstract or concrete implementation? */ unsigned int tokenIndex; /* currently active token */ tokenInfo* token [((int) NumTokens)]; @@ -234,7 +229,6 @@ } tagType;
typedef struct sParenInfo { - int pointerOrder; boolean isParamList; boolean isKnrParamList; boolean isNameCandidate; @@ -511,7 +505,6 @@ { token->type = TOKEN_NONE; token->keyword = KEYWORD_NONE; - token->pointerOrder = 0; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); vStringClear (token->name); @@ -824,7 +817,6 @@ st->declaration = DECL_NONE; } st->gotParenName = FALSE; - st->pointerOrder = 0; st->implementation = IMP_DEFAULT; st->gotArgs = FALSE; st->gotName = FALSE; @@ -1244,7 +1236,6 @@ e.kindName = tagName (type); e.kind = tagLetter (type); e.type = type; - e.pointerOrder = token->pointerOrder;
findScopeHierarchy (scope, st); addOtherFields (&e, type, st, scope); @@ -1697,7 +1688,6 @@ dest->keyword = src->keyword; dest->filePosition = src->filePosition; dest->lineNumber = src->lineNumber; - dest->pointerOrder = src->pointerOrder; vStringCopy (dest->name, src->name); }
@@ -2093,7 +2083,6 @@ case '&': case '*': /* DEBUG_PRINT("parseParens, po++\n"); */ - info->pointerOrder++; info->isKnrParamList = FALSE; if (identifierCount == 0) info->isParamList = FALSE; @@ -2218,7 +2207,6 @@
static void initParenInfo (parenInfo *const info) { - info->pointerOrder = 0; info->isParamList = TRUE; info->isKnrParamList = TRUE; info->isNameCandidate = TRUE; @@ -2257,8 +2245,6 @@ token->type = TOKEN_NAME; processName (st); st->gotParenName = TRUE; - if (! (c == '(' && info.nestedArgs)) - st->pointerOrder = info.pointerOrder; } else if (! st->gotArgs && info.isParamList) { @@ -2580,28 +2566,6 @@ setToken (st, TOKEN_BRACE_CLOSE); }
-static int getTokenPointerOrder (statementInfo *const st, int prev) -{ - const tokenInfo *prev_tmp = prevToken (st, prev); - int pointer_order = 0; - - /* ... , *const ptr; */ - if (isVariableKeyword ( prev_tmp )) - { - prev++; - prev_tmp = prevToken (st, prev); - } - - while (isType ( prev_tmp, TOKEN_STAR )) - { - pointer_order++; - prev++; - prev_tmp = prevToken (st, prev); - } - - return pointer_order; -} - static void tagCheck (statementInfo *const st) { const tokenInfo *const token = activeToken (st); @@ -2627,12 +2591,7 @@ { st->declaration = DECL_FUNCTION; if (isType (prev2, TOKEN_NAME)) - copyToken (st->blockName, prev2); - - if (!isLanguage (Lang_java)) - { - ((tokenInfo *)prev2)->pointerOrder = getTokenPointerOrder (st, 3); - } + copyToken (st->blockName, prev2); qualifyFunctionTag (st, prev2); } } @@ -2683,20 +2642,10 @@ if (isContextualKeyword (prev2)) makeTag (prev, st, TRUE, TAG_EXTERN_VAR); else - { - if (!isLanguage (Lang_java)) - { - ((tokenInfo *)prev)->pointerOrder = getTokenPointerOrder (st, 2); - } qualifyVariableTag (st, prev); - } } else if (isType (prev, TOKEN_ARGS) && isType (prev2, TOKEN_NAME)) { - if (!isLanguage (Lang_java)) - { - ((tokenInfo *)prev2)->pointerOrder = getTokenPointerOrder (st, 3); - } qualifyFunctionDeclTag (st, prev2); } break;
Modified: trunk/tagmanager/entry.h =================================================================== --- trunk/tagmanager/entry.h 2007-12-18 17:03:39 UTC (rev 2111) +++ trunk/tagmanager/entry.h 2007-12-18 17:05:56 UTC (rev 2112) @@ -60,7 +60,6 @@ boolean isFileScope; /* is tag visibile only within source file? */ boolean isFileEntry; /* is this just an entry for a file name? */ boolean truncateLine; /* truncate tag line at end of tag name? */ - int pointerOrder; /* The number of *'s this variable has */ const char *sourceFileName; /* name of source file */ const char *name; /* name of the tag */ const char *kindName; /* kind of tag */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.