[m-dev.] trivial diff: improve pretty-printing of typeclass_info cons_ids
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Sep 16 02:27:56 AEST 1999
Estimated hours taken: 0.25
compiler/mercury_to_mercury.m:
Improve the quality of the output for `typeclass_info' cons_ids.
Workspace: /home/mercury0/fjh/mercury
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.160
diff -u -r1.160 mercury_to_mercury.m
--- mercury_to_mercury.m 1999/07/13 08:53:12 1.160
+++ mercury_to_mercury.m 1999/09/13 04:56:14
@@ -1085,14 +1085,18 @@
{ string__int_to_string(Arity, ArityString) },
io__write_strings(["<type_ctor_info for ",
ModuleString, ":", Type, "/", ArityString, ">"]).
-mercury_output_cons_id(
- base_typeclass_info_const(Module, Class, _, InstanceString),
- _) -->
+mercury_output_cons_id(base_typeclass_info_const(Module, Class, InstanceNum,
+ InstanceString), _) -->
{ prog_out__sym_name_to_string(Module, ModuleString) },
io__write_string("<base_typeclass_info for "),
io__write(Class),
- io__write_strings([" from module ", ModuleString, ", instance number",
- InstanceString]).
+ ( { ModuleString \= "some bogus module name" } ->
+ io__write_strings([" from module ", ModuleString])
+ ;
+ []
+ ),
+ io__format(", instance number %d (%s)>",
+ [i(InstanceNum), s(InstanceString)]).
mercury_output_cons_id(tabling_pointer_const(_, _), _) -->
io__write_string("<tabling pointer>").
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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