On Sep 3, 2010, at 8:10 AM, Fariborz Jahanian wrote:
>>> Patch to allow alternative representation of c++
>>> operators (and, or, etc.) to be used as selectors
>>> to match g++'s behavior.
>> 
>> Hi Fariborz,
>> 
>> Instead of adding this to Token, can you just use 
>> SomeToken.getIdentifier()->isCPlusPlusOperatorKeyword() wherever you'd check 
>> Tok.isCPlusPlusOpKeyword()?
> 
> I tried this first. When we set the Identifier field to 0 when we detect such 
> tokens. I tried to remove code which does that. But there are
> assumptions of Token.getIdentifier() to be 0 and several tests broke. So, I 
> use a 1-bit flag instead.

Ah interesting!  I think it would work to catch things like "tok::ampamp", then 
check the spelling (with PP::getSpelling) to see if it is spelled "and" or 
"&&".  In the former, turn it back into an identifier.  That would localize 
this weirdness to the ObjC frontend instead of needing a bit on Token,

-Chris


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to