[m-rev.] trivial diff: fundeps in HLDS dumps

Mark Brown mark at cs.mu.OZ.AU
Wed May 11 18:51:51 AEST 2005


Estimated hours taken: 0.1
Branches: main

compiler/hlds_out.m:
	Fix the output of functional dependencies in the HLDS dump to more
	closely match the correct Mercury syntax.  I forgot to update this
	part when the proposed syntax was changed.

Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.354
diff -u -r1.354 hlds_out.m
--- compiler/hlds_out.m	20 Apr 2005 12:57:10 -0000	1.354
+++ compiler/hlds_out.m	11 May 2005 08:05:18 -0000
@@ -3467,24 +3467,13 @@
 :- pred hlds_output_fundep(hlds_class_fundep::in, io::di, io::uo) is det.
 
 hlds_output_fundep(fundep(Domain, Range), !IO) :-
-	hlds_output_fundep_2(Domain, !IO),
-	io.write_string(" >> ", !IO),
-	hlds_output_fundep_2(Range, !IO).
-
-:- pred hlds_output_fundep_2(set(hlds_class_argpos)::in, io::di, io::uo)
-	is det.
-
-hlds_output_fundep_2(ArgNumSet, !IO) :-
-	ArgNumList = set.to_sorted_list(ArgNumSet),
-	(
-		ArgNumList = [ArgNum]
-	->
-		io.write_int(ArgNum, !IO)
-	;
-		io.write_char('{', !IO),
-		io.write_list(ArgNumList, ", ", io.write_int, !IO),
-		io.write_char('}', !IO)
-	).
+	io.write_char('(', !IO),
+	DomainList = set.to_sorted_list(Domain),
+	io.write_list(DomainList, ", ", io.write_int, !IO),
+	io.write_string(" -> ", !IO),
+	RangeList = set.to_sorted_list(Range),
+	io.write_list(RangeList, ", ", io.write_int, !IO),
+	io.write_char(')', !IO).
 
 	% Just output the class methods as pred_ids and proc_ids because
 	% its probably not that useful to have the names. If that information
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list