A few cases were not handled correctly. Notably:
#define ID(X) X #define HIDE a ID(b) HIDE
spelledForExpanded() would claim HIDE is an equivalent range of the 'b' it
contains, despite the fact that HIDE also covers 'a'.
While trying to fix this bug, I found findCommonRangeForMacroArgs hard
to understand (both the implementation and how it's used in spelledForExpanded).
It relies on details of the SourceLocation graph that are IMO fairly obscure.
So I've added/revised quite a lot of comments and made some naming tweaks.
main file here and in rest of the comments feels a little confusing. maybe rename FID to MainFile (which is still somewhat confusing) or call it SpelledFID and also change the mentions of main file in comments to spelling file (or similar). (assuming i am not misunderstanding something)