[m-dev.] for review: improve termination error messages

Simon Taylor stayl at cs.mu.OZ.AU
Tue Jun 15 16:29:07 AEST 1999


Estimated hours taken: 0.5

compiler/error_util.m:
compiler/term_errors.m:
	Change code to output predicate names and pragma declarations
	to be consistent with other error messages.

	Fix some tense inconsistencies and grammar errors in the
	termination error messages.


Index: compiler/error_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/error_util.m,v
retrieving revision 1.7
diff -u -u -r1.7 error_util.m
--- error_util.m	1998/12/06 23:43:08	1.7
+++ error_util.m	1999/06/01 05:40:35
@@ -316,22 +316,23 @@
 	pred_info_get_is_pred_or_func(PredInfo, PredOrFunc),
 	(
 		PredOrFunc = predicate,
-		PredOrFuncPart = "predicate ",
+		PredOrFuncPart = "predicate",
 		OrigArity = Arity
 	;
 		PredOrFunc = function,
-		PredOrFuncPart = "function ",
+		PredOrFuncPart = "function",
 		OrigArity is Arity - 1
 	),
 	string__int_to_string(OrigArity, ArityPart),
 	string__append_list([
 		PredOrFuncPart,
+		" `",
 		ModuleNameString,
 		":",
 		PredName,
 		"/",
-		ArityPart
-		], Piece).
+		ArityPart,
+		"'"], Piece).
 
 error_util__describe_one_proc_name(Module, proc(PredId, ProcId), Piece) :-
 	error_util__describe_one_pred_name(Module, PredId, PredPiece),

Index: compiler/term_errors.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/term_errors.m,v
retrieving revision 1.14
diff -u -u -r1.14 term_errors.m
--- term_errors.m	1998/12/06 23:45:54	1.14
+++ term_errors.m	1999/06/01 02:25:20
@@ -92,7 +92,7 @@
 			% Valid error only in pass 1.
 
 	;	too_many_paths
-			% There were too many distinct paths to be analyzed.
+			% There are too many distinct paths to be analyzed.
 			% Valid in both passes (which analyze different sets
 			% of paths).
 
@@ -263,7 +263,7 @@
 term_errors__description(pragma_c_code, _, _, Pieces, no) :-
 	Pieces = [words("It depends on the properties of"),
 		words("foreign language code included via a"),
-		fixed("`pragma c_code'"),
+		fixed("`:- pragma c_code'"),
 		words("declaration.")].
 
 term_errors__description(inf_call(CallerPPId, CalleePPId),
@@ -370,7 +370,7 @@
 		OutputSuppliersNames),
 	list__map(lambda([OS::in, FOS::out] is det, (FOS = fixed(OS))),
 		OutputSuppliersNames, OutputSuppliersPieces),
-	Pieces3 = [words("was not a subset of the head variables")],
+	Pieces3 = [words("is not a subset of the head variables")],
 	term_errors_var_bag_description(HeadVars, Varset, HeadVarsNames),
 	list__map(lambda([HV::in, FHV::out] is det, (FHV = fixed(HV))),
 		HeadVarsNames, HeadVarsPieces),
@@ -395,7 +395,7 @@
 	).
 
 term_errors__description(too_many_paths, _, _, Pieces, no) :-
-	Pieces = [words("There were too many execution paths"),
+	Pieces = [words("There are too many execution paths"),
 		words("for the analysis to process.")].
 
 term_errors__description(no_eqns, _, _, Pieces, no) :-
@@ -412,12 +412,13 @@
 
 term_errors__description(does_not_term_pragma(PredId), Single, Module,
 		Pieces, no) :-
-	Pieces1 = [words("There was a `does_not_terminate' pragma defined on")],
+	Pieces1 = [words(
+		"There is a `:- pragma does_not_terminate' declaration for")],
 	(
 		Single = yes(PPId),
 		PPId = proc(SCCPredId, _),
 		require(unify(PredId, SCCPredId), "does not terminate pragma outside this SCC"),
-		Piece2 = words("It")
+		Piece2 = words("it.")
 	;
 		Single = no,
 		error_util__describe_one_pred_name(Module, PredId,
--------------------------------------------------------------------------
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