diff: fix instance decls in .int files

David Glen JEFFERY dgj at cs.mu.OZ.AU
Mon Mar 2 18:13:30 AEDT 1998


Hi,

Can you please review this, Fergus?
(BTW, I've already commited this so that Tom can get the Tk stuff working.)

Test case coming soon...


Estimated hours taken: 1/4

Fix a bug introduced by Fergus' recent changes to mercury_to_mercury.m: the
instance declarations output into the .int files were not syntactically valid.

compiler/mercury_to_mercury:
	Put an extra set of brackets around the predname in the pred/arity so
	that the compiler isn't fooled by the precedences of ":" and "/".

Index: mercury_to_mercury.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.131
diff -u -r1.131 mercury_to_mercury.m
--- 1.131	1998/02/16 17:23:03
+++ mercury_to_mercury.m	1998/03/02 05:58:02
@@ -467,13 +467,13 @@
 	io__write_char('\t'),
 	(
 		{ Method = func_instance(Name1, Name2, Arity) },
-		io__write_string("func(")
+		io__write_string("func((")
 	;
 		{ Method = pred_instance(Name1, Name2, Arity) },
-		io__write_string("pred(")
+		io__write_string("pred((")
 	),
 	mercury_output_bracketed_sym_name(Name1),
-	io__write_string("/"),
+	io__write_string(")/"),
 	io__write_int(Arity),
 	io__write_string(") is "),
 	mercury_output_bracketed_sym_name(Name2).


love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
MEngSc 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