1
1
2
2
internal void
3
- F4_CPP_ParseMacroDefinition (F4_Index_ParseCtx *ctx, F4_Index_TokenSkipFlags flags )
3
+ F4_CPP_ParseMacroDefinition (F4_Index_ParseCtx *ctx)
4
4
{
5
5
Token *name = 0 ;
6
- if (F4_Index_RequireTokenKind (ctx, TokenBaseKind_Identifier, &name, flags ))
6
+ if (F4_Index_ParsePattern (ctx, " %k " , TokenBaseKind_Identifier, &name))
7
7
{
8
8
F4_Index_MakeNote (ctx->app , ctx->file , 0 , F4_Index_StringFromToken (ctx, name),
9
9
F4_Index_NoteKind_Macro, 0 , Ii64 (name));
10
- }
11
- for (;!ctx->done ;)
12
- {
13
- Token *token = token_it_read (&ctx->it );
14
- if (!(token->flags & TokenBaseFlag_PreprocessorBody) ||
15
- token->kind == TokenBaseKind_Preprocessor)
16
- {
17
- break ;
18
- }
19
- F4_Index_ParseCtx_IncWs (ctx);
10
+ F4_Index_SkipSoftTokens (ctx, 1 );
20
11
}
21
12
}
22
13
@@ -36,7 +27,7 @@ F4_CPP_SkipParseBody(F4_Index_ParseCtx *ctx)
36
27
}
37
28
else if (F4_Index_ParsePattern (ctx, " %b" , TokenCppKind_PPDefine, &name))
38
29
{
39
- F4_CPP_ParseMacroDefinition (ctx, F4_Index_TokenSkipFlag_SkipWhitespace );
30
+ F4_CPP_ParseMacroDefinition (ctx);
40
31
}
41
32
else if (F4_Index_ParsePattern (ctx, " %t" , " {" ))
42
33
{
@@ -389,12 +380,10 @@ internal F4_LANGUAGE_INDEXFILE(F4_CPP_IndexFile)
389
380
}
390
381
391
382
// ~ NOTE(rjf): Macros
392
- else if (F4_Index_ParsePattern (ctx, " %b%k " , TokenCppKind_PPDefine, (Token **) 0 , TokenBaseKind_Identifier , &name))
383
+ else if (F4_Index_ParsePattern (ctx, " %b" , TokenCppKind_PPDefine, &name))
393
384
{
394
385
handled = 1 ;
395
- F4_Index_MakeNote (ctx->app , ctx->file , 0 , F4_Index_StringFromToken (ctx, name),
396
- F4_Index_NoteKind_Macro, 0 , Ii64 (name));
397
- F4_Index_SkipSoftTokens (ctx, 1 );
386
+ F4_CPP_ParseMacroDefinition (ctx);
398
387
}
399
388
400
389
0 commit comments