Diff of /tagmanager/ctags/c.c [f2f22d] .. [6c7f69]  Maximize  Restore

  Switch to side-by-side view

--- a/tagmanager/ctags/c.c
+++ b/tagmanager/ctags/c.c
@@ -1968,6 +1968,12 @@
 	deleteToken (token);
 }
 
+static void checkIsClassEnum (statementInfo *const st, const declType decl)
+{
+	if (! isLanguage (Lang_cpp) || st->declaration != DECL_ENUM)
+		st->declaration = decl;
+}
+
 static void processToken (tokenInfo *const token, statementInfo *const st)
 {
 	switch (token->keyword)		/* is it a reserved word? */
@@ -1979,7 +1985,7 @@
 		case KEYWORD_ATTRIBUTE:	skipParens (); initToken (token);	break;
 		case KEYWORD_CATCH:		skipParens (); skipBraces ();		break;
 		case KEYWORD_CHAR:		st->declaration = DECL_BASE;		break;
-		case KEYWORD_CLASS:		st->declaration = DECL_CLASS;		break;
+		case KEYWORD_CLASS:		checkIsClassEnum (st, DECL_CLASS);	break;
 		case KEYWORD_CONST:		st->declaration = DECL_BASE;		break;
 		case KEYWORD_DOUBLE:	st->declaration = DECL_BASE;		break;
 		case KEYWORD_ENUM:		st->declaration = DECL_ENUM;		break;
@@ -2003,7 +2009,7 @@
 		case KEYWORD_PUBLIC:	setAccess (st, ACCESS_PUBLIC);		break;
 		case KEYWORD_SHORT:		st->declaration = DECL_BASE;		break;
 		case KEYWORD_SIGNED:	st->declaration = DECL_BASE;		break;
-		case KEYWORD_STRUCT:	st->declaration = DECL_STRUCT;		break;
+		case KEYWORD_STRUCT:	checkIsClassEnum (st, DECL_STRUCT);	break;
 		case KEYWORD_THROWS:	discardTypeList (token);			break;
 		case KEYWORD_TYPEDEF:	st->scope	= SCOPE_TYPEDEF;		break;
 		case KEYWORD_UNION:		st->declaration = DECL_UNION;		break;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks