[PATCH] Support ANSI escape sequences in the Lexer

David Blaikie dblaikie at gmail.com
Tue Apr 1 19:03:06 PDT 2014


On Tue, Apr 1, 2014 at 6:27 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Tue, Apr 1, 2014 at 5:49 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>>   Any chance of test cases?
>
>
> Sorry, yes, I have some but Phabricator seems to be strangely unable to
> render them properly.

Oh, that's a pity - file a Phab bug?

> I guess it doesn't conform to ISO/IEC 6429 / ECMA-48?

No, I suppose not.

> I could take photos of the testcases on my screen and fax them to you, would
> that work? Do you have a color fax machine?

Crayon renderings dropped in my mail slot would be fine.

>>   Does this produce any ambiguities in the grammar? Or is it strictly
>> turning invalid cases into valid ones?
>
>
> It's possible for there to be ambiguities here, in cases like:
>
> #define STR(x) #x
> #define m
> const char *p = STR(<U+1B>[m);
>
> With the patch we'll emit "\x1b[m", without it we'll emit "\x1b[". Tricky.
> Any ideas?

Hmm - pity. Can't say I've got any particularly compelling ideas.
Though I assume this is at least in the domain of acceptable
implementation defined behavior regarding the translation of bytes to
the source character set, etc?



More information about the cfe-commits mailing list