diff: mercury_to_mercury.m func bug fix
Fergus Henderson
fjh at cs.mu.oz.au
Sat Aug 9 05:36:53 AEST 1997
compiler/mercury_to_mercury.m:
Fix a bug or two that showed up when exporting a func/0 with a func
declaration that combines types and modes. It was incorrectly
(a) printing the determinism in the type declaration, not just
the mode declaration and (b) printing the determinism in the
wrong place in the mode declaration.
tests/valid/Mmake.m:
tests/valid/func_int_bug.m:
tests/valid/func_int_bug_main.m:
Regression test for the above bug fix.
Index: mercury_to_mercury.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.111
diff -u -r1.111 mercury_to_mercury.m
--- mercury_to_mercury.m 1997/07/27 15:01:01 1.111
+++ mercury_to_mercury.m 1997/08/07 07:58:47
@@ -1057,16 +1057,17 @@
MaybeDet, Context) -->
{ split_types_and_modes(TypesAndModes, Types, MaybeModes) },
{ split_type_and_mode(RetTypeAndMode, RetType, MaybeRetMode) },
- mercury_output_func_type(VarSet, FuncName, Types, RetType, MaybeDet,
- Context),
(
{ MaybeModes = yes(Modes) },
{ MaybeRetMode = yes(RetMode) }
->
+ mercury_output_func_type(VarSet, FuncName, Types, RetType,
+ no, Context),
mercury_output_func_mode_decl(VarSet, FuncName, Modes, RetMode,
MaybeDet, Context)
;
- []
+ mercury_output_func_type(VarSet, FuncName, Types, RetType,
+ MaybeDet, Context),
).
mercury_output_func_type(VarSet, FuncName, Types, RetType, MaybeDet, _Context)
@@ -1081,11 +1082,11 @@
mercury_output_remaining_terms(Rest, VarSet, no),
io__write_string(")")
;
- mercury_output_bracketed_sym_name(FuncName),
- mercury_output_det_annotation(MaybeDet)
+ mercury_output_bracketed_sym_name(FuncName)
),
io__write_string(" = "),
mercury_output_term(RetType, VarSet, no),
+ mercury_output_det_annotation(MaybeDet),
io__write_string(".\n").
%-----------------------------------------------------------------------------%
--
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.
More information about the developers
mailing list