[m-dev.] [reuse] diff: pragma output fixes

Peter Ross Peter.Ross at cs.kuleuven.ac.be
Sat Oct 14 00:49:27 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 0.5

pa_run.m:
sr_run.m:
structure_reuse.m:
    When a predicate has no arguments don't output brackets after the
    var.

Index: pa_run.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_run.m,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 pa_run.m
--- pa_run.m	2000/10/13 09:33:31	1.1.2.4
+++ pa_run.m	2000/10/13 13:47:05
@@ -766,10 +766,13 @@
 	{ list__length(HeadVars, PseudoArity) }, 
 	{ NumberOfTypeInfos = PseudoArity - Arity },
 	{ list_drop_det(NumberOfTypeInfos, HeadVars, RealHeadVars) },
-	io__write_string("vars("),
-	mercury_output_vars(RealHeadVars, ProgVarset, no),
-	io__write_string(")"),
-
+	( { RealHeadVars = [] } ->
+		io__write_string("vars")
+	;
+		io__write_string("vars("),
+		mercury_output_vars(RealHeadVars, ProgVarset, no),
+		io__write_string(")")
+	),
 	io__write_string(", "),
 
 		% write alias information
Index: sr_run.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_run.m,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 sr_run.m
--- sr_run.m	2000/10/12 15:03:48	1.1.2.4
+++ sr_run.m	2000/10/13 13:47:05
@@ -123,10 +123,13 @@
 	{ list__length(HeadVars, PseudoArity) }, 
 	{ NumberOfTypeInfos = PseudoArity - Arity },
 	{ list_drop_det(NumberOfTypeInfos, HeadVars, RealHeadVars) },
-	io__write_string("vars("),
-	mercury_output_vars(RealHeadVars, ProgVarset, no),
-	io__write_string(")"),
-
+	( { RealHeadVars = [] } ->
+		io__write_string("vars")
+	;
+		io__write_string("vars("),
+		mercury_output_vars(RealHeadVars, ProgVarset, no),
+		io__write_string(")")
+	),
 	io__write_string(", "),
 
 		% write reuse information
Index: structure_reuse.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/structure_reuse.m,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 structure_reuse.m
--- structure_reuse.m	2000/10/12 15:03:49	1.1.2.3
+++ structure_reuse.m	2000/10/13 13:47:05
@@ -137,10 +137,13 @@
 	{ list__length(HeadVars, PseudoArity) }, 
 	{ NumberOfTypeInfos = PseudoArity - Arity },
 	{ list_drop_det(NumberOfTypeInfos, HeadVars, RealHeadVars) },
-	io__write_string("vars("),
-	mercury_output_vars(RealHeadVars, ProgVarset, no),
-	io__write_string(")"),
-
+	( { RealHeadVars = [] } ->
+		io__write_string("vars")
+	;
+		io__write_string("vars("),
+		mercury_output_vars(RealHeadVars, ProgVarset, no),
+		io__write_string(")")
+	),
 	io__write_string(", "),
 
 		% write reuse information

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