[m-rev.] diff: fix compilation of moose

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Dec 5 17:39:31 AEDT 2006


Estimated hours taken: 0.1
Branches: main

Conform to recent stdlib changes.

extras/moose/mercury_syntax.m:
extras/moose/moose.m:
 	Conform to the recent change change in the representation
 	of variables in the term module.

Julien.

Index: mercury_syntax.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/moose/mercury_syntax.m,v
retrieving revision 1.4
diff -u -r1.4 mercury_syntax.m
--- mercury_syntax.m	30 Mar 2006 01:21:17 -0000	1.4
+++ mercury_syntax.m	5 Dec 2006 04:38:13 -0000
@@ -285,8 +285,7 @@
  :- pred get_context(term, context).
  :- mode get_context(in, out) is det.

-get_context(variable(_), Context) :-
-	term__context_init(Context).
+get_context(variable(_, Context), Context).
  get_context(functor(_, _, Context), Context).

  %------------------------------------------------------------------------------%
Index: moose.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/moose/moose.m,v
retrieving revision 1.10
diff -u -r1.10 moose.m
--- moose.m	30 Mar 2006 01:21:18 -0000	1.10
+++ moose.m	5 Dec 2006 04:42:34 -0000
@@ -528,7 +528,7 @@
  	varset__new_vars(V0, Arity, Vars, _),
  	term__context_init(Ctxt),
  	list__map((pred(Var::in, T::out) is det :-
-		T = variable(Var)
+		T = variable(Var, Ctxt)
  	), Vars, Args),
  	Term = functor(atom(Name), Args, Ctxt).
  terminal_to_term(($), End, End).
@@ -610,7 +610,7 @@
  	varset__new_vars(V0, Arity, Vars, _),
  	term__context_init(Ctxt),
  	list__map((pred(Var::in, T::out) is det :-
-		T = variable(Var)
+		T = variable(Var, Ctxt)
  	), Vars, Args),
  	Term = functor(atom(Name), Args, Ctxt).

@@ -718,7 +718,7 @@
  	;
  		string__format("V%d", [i(N)], VarName),
  		varset__new_named_var(!.Varset, VarName, Var, !:Varset),
-		Term = term__variable(Var),
+		Term = term__variable(Var, context_init),
  		list__append([Term], !Terms),
  		mkstartargs(N - 1, !Terms, !Varset)
  	).
@@ -802,30 +802,30 @@
  				s(InAtom), s(OutAtom)],
  			!IO),
  		Rule = rule(RNt, Head, _, Body, Actions, Varset0, _C),
+		term__context_init(Ctxt),
  		varset__new_named_var(Varset0, "M_St0", St0v, Varset1),
-		St0 = variable(St0v),
+		St0 = variable(St0v, Ctxt),
  		varset__new_named_var(Varset1, "M_St1", St1v, Varset2),
-		St1 = variable(St1v),
+		St1 = variable(St1v, Ctxt),
  		varset__new_named_var(Varset2, "M_Sy0", Sy0v, Varset3),
-		Sy0 = variable(Sy0v),
+		Sy0 = variable(Sy0v, Ctxt),
  		varset__new_named_var(Varset3, "M_Sy1", Sy1v, Varset4),
-		Sy1 = variable(Sy1v),
+		Sy1 = variable(Sy1v, Ctxt),
  		varset__new_named_var(Varset4, "M_RedRes", Resv, Varset5),
-		Res = variable(Resv),
-		ResS = functor(atom("n"), [variable(Resv)], Ctxt),
+		Res = variable(Resv, Ctxt),
+		ResS = functor(atom("n"), [variable(Resv, Ctxt)], Ctxt),
  		varset__new_named_var(Varset5, "M_D", Dv, Varset6),
-		_D = variable(Dv),
+		_D = variable(Dv, Ctxt),
  		varset__new_named_var(Varset6, "M_S", Sv, Varset7),
-		_S = variable(Sv),
+		_S = variable(Sv, Ctxt),
  		varset__new_named_var(Varset7, "M_St", Stv, Varset8),
-		St = variable(Stv),
+		St = variable(Stv, Ctxt),
  		varset__new_named_var(Varset8, "M_Sy", Syv, Varset9),
-		Sy = variable(Syv),
+		Sy = variable(Syv, Ctxt),
  		varset__new_named_var(Varset9, "M_Ts0", Ts0v, Varset10),
-		Ts0 = variable(Ts0v),
+		Ts0 = variable(Ts0v, Ctxt),
  		varset__new_named_var(Varset10, "M_Ts", Tsv, Varset11),
-		Ts = variable(Tsv),
-		term__context_init(Ctxt),
+		Ts = variable(Tsv, Ctxt),
  		string__format("reduction 0x%x failed!", [i(Rn)], Err),
  		mkstacks(Body, St1, Sts, Sy1, Sys, Varset11, Varset12),
  		Cond = functor(atom(","), [
@@ -910,7 +910,7 @@
  		E = functor(atom("n"), [EN], Ctxt)
  	),
  	!:Sy = functor(atom("[|]"), [E, !.Sy], Ctxt),
-	!:St = functor(atom("[|]"), [variable(U), !.St], Ctxt),
+	!:St = functor(atom("[|]"), [variable(U, Ctxt), !.St], Ctxt),
  	mkstacks(Es, !St, !Sy, !VS).

  :- pred mkactions(list(term), term, term).

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list