[m-rev.] diff: fix up typecheck.m

Julien Fischer juliensf at students.cs.mu.OZ.AU
Thu Mar 18 18:48:05 AEDT 2004


Estimated hours: 0.1
Branches: main

After the last change to this module the comment about how DCGs
are used no longer applies.  They are now only used for threading
the IO state.

compiler/typecheck.m:
	Remove a comment at the head of the module that
	no longer applies.

	s/io__state/io/ in a few spots.

	Add an end_module declaration.

Julien.

Index: typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.349
diff -u -r1.349 typecheck.m
--- typecheck.m	23 Dec 2003 03:14:10 -0000	1.349
+++ typecheck.m	18 Mar 2004 07:39:23 -0000
@@ -23,30 +23,6 @@
 % 	Access predicates for the typecheck_info data structure are called
 % 	typecheck_info_*.
 %
-% Note that DCGS are used for THREE different purposes in this file:
-%
-%	1.  For accumulating io__states as usual.
-%
-%	2.  For accumulating typecheck_infos, which contain:
-%		- an io_state, which is modified if we need to
-%		  write out an error message
-%		- various semi-global info which doesn't change often,
-%		  namely the pred_id and prog_context of the clause
-%		  we are type-checking
-%		- a type_assign_set which stores the set of possible
-%		  type assignments and is modified as we traverse through
-%		  the clause
-%
-%	3.  For accumulating type_assign_sets.  This is when we are
-%	    type-checking a single atomic construct (unification or
-%	    predicate), and we are iterating through all the
-%	    possible existing type-assignments to accumulate a new
-%	    type-assignment set.
-%
-% This can be a little confusing if you're not aware of it, so be
-% careful to look at the pred declarations to see what each DCG predicate
-% is actually accumulating.
-%
 % There are four sorts of types:
 %
 % 1) discriminated unions:
@@ -191,7 +167,7 @@
 	% Type-check the code for all the predicates in a module.

 :- pred typecheck_module(module_info::in, module_info::out,
-	bool::out, bool::out, io__state::di, io__state::uo) is det.
+	bool::out, bool::out, io::di, io::uo) is det.

 typecheck_module(!Module, FoundError, ExceededIterationLimit, !IO) :-
 	module_info_predids(!.Module, PredIds),
@@ -206,7 +182,7 @@

 :- pred typecheck_to_fixpoint(int::in, int::in, list(pred_id)::in,
 	module_info::in, module_info::out, bool::out, bool::out,
-	io__state::di, io__state::uo) is det.
+	io::di, io::uo) is det.

 typecheck_to_fixpoint(Iteration, NumIterations, PredIds, !Module,
 		FoundError, ExceededIterationLimit, !IO) :-
@@ -255,7 +231,7 @@

 :- pred typecheck_module_one_iteration(int::in, list(pred_id)::in,
 	module_info::in, module_info::out, bool::in, bool::out,
-	bool::in, bool::out, io__state::di, io__state::uo) is det.
+	bool::in, bool::out, io::di, io::uo) is det.

 typecheck_module_one_iteration(_, [], !ModuleInfo, !Error, !Changed, !IO).
 typecheck_module_one_iteration(Iteration, [PredId | PredIds], !ModuleInfo,
@@ -307,7 +283,7 @@

 :- pred typecheck_pred_if_needed(int::in, pred_id::in,
 	pred_info::in, pred_info::out, module_info::in, module_info::out,
-	bool::out, bool::out, io__state::di, io__state::uo) is det.
+	bool::out, bool::out, io::di, io::uo) is det.

 typecheck_pred_if_needed(Iteration, PredId, !PredInfo, !ModuleInfo,
 		Error, Changed, !IO) :-
@@ -343,7 +319,7 @@

 :- pred typecheck_pred(int::in, pred_id::in,
 	pred_info::in, pred_info::out, module_info::in, module_info::out,
-	bool::out, bool::out, io__state::di, io__state::uo) is det.
+	bool::out, bool::out, io::di, io::uo) is det.

 typecheck_pred(Iteration, PredId, !PredInfo, !ModuleInfo, Error, Changed,
 		!IO) :-
@@ -5415,7 +5391,7 @@
 	mercury_output_term(Type, TVarSet, no, !IO).

 :- pred write_types_list(prog_context::in, list(string)::in,
-	io__state::di, io__state::uo) is det.
+	io::di, io::uo) is det.

 write_types_list(_Context, []) --> [].
 write_types_list(Context, [Type | Types]) -->
@@ -6223,4 +6199,6 @@
 		find_first(Pred, Xs, Result)
 	).

+%-----------------------------------------------------------------------------%
+:- end_module typecheck.
 %-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list