Adds semantic highlighting for tokens that are a macro argument.
#define D_V(X) int X = 1230 D_V(SomeVar);
The "SomeVar" inside the macro is highlighted as a variable now.
Tokens that are in a macro body expansion are ignored in this patch for three reasons.
- The spelling loc is inside the macro "definition" meaning it would highlight inside the macro definition (could probably easily be fixed by using getExpansionLoc instead of getSpellingLoc?)
- If wanting to highlight the macro definition this could create duplicate tokens. And if the tokens are of different types there would be conflicts (tokens in the same range but with different types). Say a macro defines some name and both a variable declaration and a function use this, there would be two tokens in the macro definition but one with Kind "Variable" and the other with Kind "Function".
- Thirdly, macro body expansions could come from a file that is not the main file (easily fixed, just check that the Loc is in the main file and not even a problem if we wanted to highlight the actual macro "invocation")