[m-rev.] for review: read Mercury files using read_file_as_string

Peter Wang novalazy at gmail.com
Mon Jul 29 19:43:44 AEST 2019


On Mon, 29 Jul 2019 10:40:02 +0200 (CEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> 
> On Sun, 28 Jul 2019 11:35:07 +1000, Peter Wang <novalazy at gmail.com> wrote:
> > > IIRC, that test was not added because of any specfic issue with the
> > > compiler but as part of change by Simon to prevent null chars being used
> > > in Mercury generally.
> > 
> > I think it's fine just to comment out the lines containing NUL bytes.
> 
> That would be equivalent to deleting the test, since detecting NUL bytes
> is its only job.

It detects NUL bytes introduced in two ways: raw NUL bytes,
and escape sequences which would result in NUL bytes after unescaping.
Only the lines containing raw NUL bytes need to be deleted (wrong6, wrong9).
Despite what I wrote before, commenting them out won't work.

> 
> > > I suggest you add the C implementation and a fallbck Mercury implementation
> > > (as we have with read_file_as_string).  I can add the Java version.
> > > My Erlang is probably not up to the task of adding it for that language :-(
> 
> Attached is the proposed diff, for review by Peter (the Erlang part) and Julien
> (everything else).

It looks fine.

Peter


More information about the reviews mailing list