[cfe-dev] Confusing comment on LexTokenInternal

AlisdairM(public) public at alisdairm.net
Wed Jul 8 15:34:40 PDT 2009


> -----Original Message-----
> From: Neil Booth [mailto:neil at daikokuya.co.uk]
> Sent: 08 July 2009 23:25
> To: AlisdairM(public)
> Cc: 'Chris Lattner'; 'clang-dev Developers'
> Subject: Re: [cfe-dev] Confusing comment on LexTokenInternal
> 
> AlisdairM(public) wrote:-
> 
> > The problem is not that string_literal cannot handle the
> wide_string_literal cases, that was easy to fix up.  However, there are
> a few places in the grammar that require string literal be exactly that
> - a narrow string literal.  Examples are #include "myfile" and extern
> "C".
> 
> That doesn't seem like a reason to scrap the plan.  All such places
> need the spelling as they're going to do something with it, such
> as check it is "C" or "C++" in the extern case.  Rather than check
> the token type to be a narrow string, they simply need to check
> spelling[0] is a single quote.

The difference is that code is already in place and works, acting purely off the existing token definitions.  If I decide to merge, it is not enough to remove all references to wide_string_literal (easy) but I need to make sure I do not miss any references to string_literal that do NOT have additional logic for wide_string_literal and add the additional logic to test for a prefix *or suffix*.  The risk of introducing bugs into already working, tested code is too high for me.

(yes, your suggestion was my initial reaction too. I simply did not like what my code audit turned up)

AlisdairM







More information about the cfe-dev mailing list