Skip to content

Commit 3ae0a8e

Browse files
authored
Merge pull request #18 from grouse/bug/index_typed_enums
Add support for typed enums (enum foo : long long {}) in the code index
2 parents cdee9a1 + 7321d75 commit 3ae0a8e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

4coder_fleury_lang_cpp.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ internal F4_LANGUAGE_INDEXFILE(F4_CPP_IndexFile)
110110
F4_Index_NoteFlags note_flags = 0;
111111
F4_Index_RequireTokenKind(ctx, TokenBaseKind_Identifier, &name, flags);
112112

113+
if (F4_Index_PeekToken(ctx, S8Lit(":"))) {
114+
F4_Index_RequireToken(ctx, S8Lit(":"), flags);
115+
116+
while (!ctx->done) {
117+
if (F4_Index_PeekTokenKind(ctx, TokenBaseKind_Identifier, nullptr) ||
118+
F4_Index_PeekTokenKind(ctx, TokenBaseKind_Keyword, nullptr))
119+
{
120+
F4_Index_ParseCtx_Inc(ctx, flags);
121+
} else {
122+
break;
123+
}
124+
}
125+
}
126+
113127
if(F4_Index_RequireToken(ctx, S8Lit("{"), flags))
114128
{
115129
Token *constant = 0;

0 commit comments

Comments
 (0)