[PATCH] C++ preprocessor fixes
zwabel at googlemail.com
Fri Nov 26 02:17:56 UTC 2010
2010/11/25 Dmitry Risenberg <dmitry.risenberg at gmail.com>:
>> About the one test you've commented out: Since the checked position is
>> at the start of the merged token, it should be possible to map it. Why
>> doesn't that work anymore?
> I can correctly map the beginning of the token, but not the end of it,
> because after it has been merged, further recursive macro expansion
> treats it as one identifier of summary length. In this exact case, I
> get (1, 5) -> (1, 15) range instead of required (1, 5) -> (1, 11).
Hmm ok but this needs to be fixed somehow. The tracking doesn't need
to be exact, the old code also wasn't able to track the position where
two tokens were merged through token-merging. However it is important
that all the ranges resulting from one macro-invocation like
TEST(Hallo) in our case, must be trimmed to the area between the
parens, else we will get completely crazy highlighting over the parens
and whatever is behind them. In worst-case, the ranges should at least
be collapsed, so that you would get a (1,5) -> (1,5) range.
More information about the KDevelop-devel