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

Robert Ernst Johann JESCHOFNIK rejj at students.cs.mu.oz.au
Mon Feb 14 12:31:05 AEDT 2000


On Sat, 12 Feb 2000, Fergus Henderson wrote:

Hi.

[...]
> 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 ;-)

Well, that is a good start. :) error_util puts a space between every
element of the "words" list (or whatever you call it), so there was a
space before the period - I just string__appended it on the end instead.

However, error_util__describe_one_pred_name, like hlds_out__write_pred_id
puts the word "predicate" or "function" along with the name/arity. This
means that when long lines get wrapped, this word is being wrapped along
with the pred name.

eg,

insead of:
! pragma_c_code_dup_var.m:014: Error: no clauses for function `pragma_c_code_dup_var:bread_impl/7'.

we get:
! pragma_c_code_dup_var.m:014: Error: no clauses for
! pragma_c_code_dup_var.m:014:   function `pragma_c_code_dup_var:bread_impl/7'.

Is that okay?
(it would be nicer if "function" didn't wrap, but still..)




Rob

--------------------------------------------------------------------------
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