[m-dev.] diff: begin using functionality from error_util in typecheck.m

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 12 18:42:28 AEDT 2000


On 10-Feb-2000, Robert Ernst Johann JESCHOFNIK <rejj at students.cs.mu.oz.au> wrote:
> Index: typecheck.m
> ===================================================================
> RCS file: /home/mercury1/repository//mercury/compiler/typecheck.m,v
> retrieving revision 1.269
> diff -u -r1.269 typecheck.m
> --- typecheck.m	2000/01/13 06:17:14	1.269
> +++ typecheck.m	2000/01/27 03:09:45
> @@ -4500,10 +4500,14 @@
>  
>  report_error_no_clauses(PredId, PredInfo, ModuleInfo) -->
>  	{ pred_info_context(PredInfo, Context) },
> -	prog_out__write_context(Context),
> -	io__write_string("Error: no clauses for "),
> -	hlds_out__write_pred_id(ModuleInfo, PredId),
> -	io__write_string(".\n").
> +	{ error_util__describe_one_pred_name(ModuleInfo, PredId, PredName) },
> +	{ ErrorMsg0 = [ "Error: no clauses for ", PredName, "." ] },
> +	{ error_util__list_to_pieces(ErrorMsg0, ErrorMsg) },
> +	error_util__write_error_pieces(Context, 0, ErrorMsg).

Unfortunately that change broke a lot of the test cases in tests/invalid.
See the output of the nightly tests in
/home/mercury/public/logs/test_mercury_*.out.

In particular, the problem seems to be that error_util__list_to_pieces
converts a list into pieces by adding ", " and " and ".

Probably what you need instead of

> +	{ ErrorMsg0 = [ "Error: no clauses for ", PredName, "." ] },
> +	{ error_util__list_to_pieces(ErrorMsg0, ErrorMsg) },

is

	{ ErrorMsg = [ words("Error: no clauses for "), fixed(PredName),
			fixed(".") ] },

However, that's just a guess... don't take my word for it ;-)

Part of the reason for this bug is that the documentation
for error_util__list_to_pieces is not clear, so it might be
a good idea to improve that documentation.

You will probably need to update many of the *.err_exp files in
tests/invalid, since the output will presumably not be identical
to what it used to be -- with error_util, it should wrap long lines
that previously were not wrapped.

Anyway, if you could please fix this ASAP, that would be great.
If you can't fix it soon, then please back out (i.e. undo) your
previous change until it can be fixed.

Thanks,
	Fergus.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list