[m-rev.] for review: escape all control characters in io.write, deconstruct.functor

Julien Fischer jfischer at opturion.com
Tue Jun 19 17:05:57 AEST 2018


Hi Peter,

On Tue, 19 Jun 2018, Peter Wang wrote:

> On Fri, 15 Jun 2018 18:02:56 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> For review by anyone.
>>
>> I'll update the NEWS file seprately.
>>
>> ----------------------------------------------------
>>
>> Escape all control characters in io.write, deconstruct.functor etc.
>>
>> The above predicates currently escape all of the C0 control characters (+
>> Delete).  This change modifies them to escape all of the characters in the
>> Unicode category `Other,control' using backslash escapes when they exist and
>> octal escapes otherwise.
>
> Can we switch to hexadecimal escapes (later), seeing as the behaviour
> wasn't documented?

I have no objection to doing so.  (I would prefer to use the Unicode
style escapes, i.e \u and \U over \x however.)

I would also like to add support \e as an escape for the escape character.

>>   %---------------------------------------------------------------------------%
>> @@ -942,39 +942,43 @@ mercury_escape_char(Char) = EscapeCode :-
>>       % Note: the code here is similar to code in runtime/mercury_trace_base.c;
>>       % any changes here may require similar changes there.
>>
>> +% Codepoints: 0x20 -> 0x2f.
>
> I suggest:
>
>    % Codepoints in 0x20..0x2f
>    ...
>    % Codepoints in 0x30..0x3f
>    ...

Done.

Thanks for that.

Julien.


More information about the reviews mailing list