Skip to content

Commit

Permalink
Fix parsing of C++11 final classes
Browse files Browse the repository at this point in the history
Closes #3577559.
  • Loading branch information
b4n committed Oct 19, 2012
1 parent b626cc9 commit f04df05
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tagmanager/ctags/c.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static const keywordDesc KeywordTable [] = {
{ "extends", KEYWORD_EXTENDS, { 0, 0, 0, 1, 1, 0, 0 } },
{ "extern", KEYWORD_EXTERN, { 1, 1, 1, 0, 1, 1, 0 } },
{ "extern", KEYWORD_NAMESPACE, { 0, 0, 0, 0, 0, 0, 1 } }, /* parse block */
{ "final", KEYWORD_FINAL, { 0, 0, 0, 1, 0, 0, 1 } },
{ "final", KEYWORD_FINAL, { 0, 1, 0, 1, 0, 0, 1 } },
{ "finally", KEYWORD_FINALLY, { 0, 0, 0, 0, 0, 1, 1 } },
{ "float", KEYWORD_FLOAT, { 1, 1, 1, 1, 0, 1, 1 } },
{ "for", KEYWORD_FOR, { 1, 1, 1, 1, 0, 1, 1 } },
Expand Down Expand Up @@ -2955,6 +2955,13 @@ static void tagCheck (statementInfo *const st)
}
}
}
/* C++ 11 allows class <name> final { ... } */
else if (isLanguage (Lang_cpp) && isType (prev, TOKEN_KEYWORD) &&
prev->keyword == KEYWORD_FINAL && isType(prev2, TOKEN_NAME))
{
name_token = (tokenInfo *)prev2;
copyToken (st->blockName, name_token);
}
else if (isLanguage (Lang_csharp))
makeTag (prev, st, FALSE, TAG_PROPERTY);
else
Expand Down

0 comments on commit f04df05

Please sign in to comment.