diff: interface files w/ existential & universal constraints

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Aug 19 16:34:43 AEST 1998


Hi,

Can you please review this Tyse?

-----------------------------------------------------------------------------

Estimated hours taken: 1

compiler/mercury_to_mercury.m:
	Get the parentheses in the right spot when spitting out the "pred"
	declaration which has both existential and universal constraints.

Index: mercury_to_mercury.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.142
diff -u -t -r1.142 mercury_to_mercury.m
--- mercury_to_mercury.m	1998/08/07 00:49:11	1.142
+++ mercury_to_mercury.m	1998/08/17 08:44:47
@@ -1307,20 +1307,10 @@
                 mercury_output_term(Type, VarSet, no),
                 mercury_output_remaining_terms(Rest, VarSet, no),
                 io__write_string(")"),
-                mercury_output_class_context(ClassContext, VarSet),
-                ( { ExistQVars = [] } -> 
-                        [] 
-                ; 
-                        io__write_string(")")
-                )
+                mercury_output_class_context(ClassContext, VarSet)
         ;
                 mercury_output_bracketed_sym_name(PredName),
                 mercury_output_class_context(ClassContext, VarSet),
-                ( { ExistQVars = [] } -> 
-                        [] 
-                ; 
-                        io__write_string(")")
-                ),
                 mercury_output_det_annotation(MaybeDet)
         ),
 
@@ -1416,11 +1406,6 @@
         io__write_string(" = "),
         mercury_output_term(RetType, VarSet, no),
         mercury_output_class_context(ClassContext, VarSet),
-        ( { ExistQVars = [] } -> 
-                [] 
-        ; 
-                io__write_string(")")
-        ),
         mercury_output_det_annotation(MaybeDet),
         io__write_string(Separator).
 
@@ -1444,6 +1429,11 @@
 mercury_output_class_context(ClassContext, VarSet) -->
         { ClassContext = constraints(UnivCs, ExistCs) },
         mercury_output_class_constraint_list(ExistCs, VarSet, "&"),
+        ( { ExistCs = [] } -> 
+                [] 
+        ; 
+                io__write_string(")")
+        ),
         mercury_output_class_constraint_list(UnivCs, VarSet, "<=").
 
 :- pred mercury_output_class_constraint_list(list(class_constraint), varset, 
-----------------------------------------------------------------------------



love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
PhD student,                    |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list