Skip to content

Commit

Permalink
C#: Correctly parse enums with a base type specifier
Browse files Browse the repository at this point in the history
See CSharp Language Specification 14.1.
  • Loading branch information
b4n committed Jul 14, 2013
1 parent d91c532 commit af5dfba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tagmanager/ctags/c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,8 @@ static void processColon (statementInfo *const st)
else if (c == ';')
setToken (st, TOKEN_SEMICOLON);
}
else if (isLanguage (Lang_cpp) && st->declaration == DECL_ENUM)
else if ((isLanguage (Lang_cpp) || isLanguage (Lang_csharp)) &&
st->declaration == DECL_ENUM)
{
/* skip enum's base type */
c = skipToOneOf ("{;");
Expand Down
6 changes: 3 additions & 3 deletions tests/ctags/bug1515910.cs.tags
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# format=tagmanager
C�1�0
Enum1�2�0
MyGenericClass1�1�0
Value1�4�byte�0
Values�4�byte�0
byte�2�0
Value1�4�Enum1�0
Values�4�Enum1�0
int1�8�C�0�int
str1�8�C�0
str2�8�C�0
Expand Down

0 comments on commit af5dfba

Please sign in to comment.