[m-rev.] for review: add character escapes in string_to_doc/1

Peter Wang novalazy at gmail.com
Tue Jul 17 12:40:04 AEST 2018


On Tue, 17 Jul 2018 12:12:39 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
> 
> For review by anyone.
> 
> ---------------------------------
> 
> Add character escapes in string_to_doc/1.
> 
> library/string.m:
>      In adddition to surrounding the argument of string_to_doc/1 with double
>      quotes, also add the usual character escapes.

addition

> tests/declarative_debugger/sort.exp:
>      Conform to the above change.
> 
> NEWS:
>      Announce this change.
> 
> Julien.
> 
> diff --git a/NEWS b/NEWS
> index ec6af97..882c4bd 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -314,6 +314,9 @@ Changes to the Mercury standard library:
> 
>   * We have reduced the memory allocated by string.to_lower and string.to_upper.
> 
> +* string.string_to_doc/1 now inserts any required character escapes in its
> +  argument, in addition to surrouding it with double quotes.
> +

surrounding

I suggest:

* string.string_to_doc/1 now replaces characters in its input argument
  with backslash escapes when required.


Peter


More information about the reviews mailing list