Skip to content

Commit af5dfba

Browse files
committed
C#: Correctly parse enums with a base type specifier
See CSharp Language Specification 14.1.
1 parent d91c532 commit af5dfba

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tagmanager/ctags/c.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,8 @@ static void processColon (statementInfo *const st)
26372637
else if (c == ';')
26382638
setToken (st, TOKEN_SEMICOLON);
26392639
}
2640-
else if (isLanguage (Lang_cpp) && st->declaration == DECL_ENUM)
2640+
else if ((isLanguage (Lang_cpp) || isLanguage (Lang_csharp)) &&
2641+
st->declaration == DECL_ENUM)
26412642
{
26422643
/* skip enum's base type */
26432644
c = skipToOneOf ("{;");

tests/ctags/bug1515910.cs.tags

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# format=tagmanager
22
C�1�0
3+
Enum1�2�0
34
MyGenericClass1�1�0
4-
Value1�4�byte�0
5-
Values�4�byte�0
6-
byte�2�0
5+
Value1�4�Enum1�0
6+
Values�4�Enum1�0
77
int1�8�C�0�int
88
str1�8�C�0
99
str2�8�C�0

0 commit comments

Comments
 (0)