[cfe-commits] r148389 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/LiteralSupport.cpp

Eli Friedman eli.friedman at gmail.com
Sun Jan 22 17:14:02 PST 2012


On Sun, Jan 22, 2012 at 6:13 AM, Seth Cantrell <seth.cantrell at gmail.com> wrote:
>
> Okay, this isn't a patch, I just want to know if this is the direction you're looking for. The included changes will result in an error message like:
>
> tmp.cpp:3:10: error: illegal sequence in character literal
> char a = '<f1>';
>          ^
>
> It doesn't do anything to try to make the highlighted ranges look correct for the modified source line. This will cause a problem similar to the one that already exists with multi-byte UTF-8 encodings, where carets and ranges do not appear correct after these sequences.

It's sort of related, but this should only affect the way the caret is
printed; this substitution shouldn't affect the actual computed column
numbers (which I think are supposed to be in raw code units).

> Also, I think it would be better if these <XX> strings could be displayed with a reversed color scheme, just like vi, if the console supports it. Is there any possibility of doing that?

Sure, I don't see why not; we already use colors for diagnostics.

> Anyway, here are the changes I am contemplating:

[...]

Yes, that's the sort of thing I was thinking of.  Might as well catch
unprintable control characters as well while you're here.

-Eli




More information about the cfe-commits mailing list