[m-rev.] diff: better determinism error messages
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri May 14 18:39:14 AEST 2004
Detect when a predicate has a pair of I/O states but isn't det or cc_multi.
Improve the generation of determinism error messages.
compiler/det_analysis.m:
Detect when a predicate has a pair of I/O states but isn't det or
cc_multi.
Factor out some common code.
compiler/det_report.m:
Add the new error type for predicates with I/O states.
Use error_util much more extensively to generate error messages.
compiler/hlds_out.m:
For several existing predicates that write out various HLDS
constructs, provide versions that return representations of those
constructs as strings or as error_util pieces, for use by det_report.m.
Redefine the old predicates as simply printing the output of the new
predicates where relevant, to avoid code duplication.
compiler/error_util.m:
When describing a predicate name, specify whether we want to module
qualify the name or not. The intention is that when generating a kind
of error message which can only be generated for predicates defined
in the current module, the module prefix should be omitted in the
interest of clarity.
compiler/accumulator.m:
compiler/dead_proc_elim.m:
compiler/magic_util.m:
compiler/table_gen.m:
compiler/term_errors.m:
compiler/termination.m:
compiler/typecheck.m:
Conform to the changes in error_util.m.
compiler/globals.m:
Reorder arguments to allow the use of state variable notation.
compiler/handle_globals.m:
compiler/mercury_compile.m:
compiler/source_file_map.m:
Conform to the changed argument order in globals.m.
tests/invalid/aditi_update_errors.err_exp:
tests/invalid/errors2.err_exp2:
tests/invalid/external.err_exp:
tests/invalid/ho_unique_error.err_exp:
tests/invalid/magicbox.err_exp:
tests/invalid/missing_det_decls.err_exp:
tests/invalid/mostly_uniq1.err_exp:
tests/invalid/mostly_uniq2.err_exp:
tests/invalid/multimode_syntax.err_exp:
tests/invalid/multisoln_func.err_exp:
tests/invalid/pragma_c_code_dup_var.err_exp:
tests/invalid/pragma_c_code_no_det.err_exp:
tests/invalid/prog_io_erroneous.err_exp2:
tests/invalid/qualified_cons_id2.err_exp:
tests/invalid/record_syntax_errors.err_exp:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/typeclass_mode.err_exp:
tests/invalid/types.err_exp2:
tests/invalid/undef_mode_and_no_clauses.err_exp:
tests/recompilation/typeclass_method_pragma_r.err_exp.2:
tests/warnings/ambiguous_overloading.exp:
tests/warnings/duplicate_call.exp:
tests/warnings/duplicate_const.exp:
tests/warnings/infinite_recursion.exp:
tests/warnings/simple_code.exp:
tests/warnings/warn_dead_procs.exp:
tests/warnings/warn_stubs.exp:
Update these files to expect the better error messages we now generate.
Zoltan.
cvs server: Diffing .
cvs server: Diffing analysis
cvs server: Diffing bindist
cvs server: Diffing boehm_gc
cvs server: Diffing boehm_gc/Mac_files
cvs server: Diffing boehm_gc/cord
cvs server: Diffing boehm_gc/cord/private
cvs server: Diffing boehm_gc/doc
cvs server: Diffing boehm_gc/include
cvs server: Diffing boehm_gc/include/private
cvs server: Diffing boehm_gc/tests
cvs server: Diffing browser
cvs server: Diffing bytecode
cvs server: Diffing compiler
Index: compiler/accumulator.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.28
diff -u -r1.28 accumulator.m
--- compiler/accumulator.m 5 Apr 2004 05:06:44 -0000 1.28
+++ compiler/accumulator.m 14 May 2004 08:30:24 -0000
@@ -246,8 +246,8 @@
->
true
;
- describe_one_pred_name(!.ModuleInfo, PredId,
- PredName),
+ describe_one_pred_name(!.ModuleInfo,
+ should_module_qualify, PredId, PredName),
pred_info_context(PredInfo, Context),
error_util__write_error_pieces(Context, 0,
@@ -333,7 +333,8 @@
output_warning(warn(Context, PredId, VarA, VarB), VarSet, ModuleInfo,
Context, Formats) :-
- describe_one_pred_name(ModuleInfo, PredId, PredStr),
+ describe_one_pred_name(ModuleInfo, should_module_qualify, PredId,
+ PredStr),
varset__lookup_name(VarSet, VarA, VarAStr0),
varset__lookup_name(VarSet, VarB, VarBStr0),
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.89
diff -u -r1.89 dead_proc_elim.m
--- compiler/dead_proc_elim.m 5 Apr 2004 05:06:46 -0000 1.89
+++ compiler/dead_proc_elim.m 14 May 2004 08:30:24 -0000
@@ -674,8 +674,8 @@
module_info::in, io::di, io::uo) is det.
warn_dead_proc(PredId, ProcId, Context, ModuleInfo, !IO) :-
- describe_one_proc_name(ModuleInfo, proc(PredId, ProcId),
- ProcName),
+ describe_one_proc_name(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), ProcName),
Components = [words("Warning:"), fixed(ProcName),
words("is never called.")],
error_util__report_warning(Context, 0, Components, !IO).
Index: compiler/det_analysis.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_analysis.m,v
retrieving revision 1.166
diff -u -r1.166 det_analysis.m
--- compiler/det_analysis.m 8 Apr 2004 03:51:39 -0000 1.166
+++ compiler/det_analysis.m 14 May 2004 08:30:25 -0000
@@ -130,6 +130,7 @@
:- import_module check_hlds__modecheck_call.
:- import_module check_hlds__purity.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_out.
:- import_module hlds__passes_aux.
:- import_module libs__options.
@@ -199,19 +200,14 @@
det_infer_proc(PredId, ProcId, !ModuleInfo, Globals,
Detism0, Detism, ProcMsgs),
( Detism = Detism0 ->
- ( Debug = yes ->
- io__write_string("% Inferred old detism ", !IO),
- mercury_output_det(Detism, !IO),
- io__write_string(" for ", !IO),
- hlds_out__write_pred_proc_id(!.ModuleInfo,
- PredId, ProcId, !IO),
- io__write_string("\n", !IO)
- ;
- true
- )
+ ChangeStr = "old"
;
+ ChangeStr = "new",
+ !:Changed = changed
+ ),
( Debug = yes ->
- io__write_string("% Inferred new detism ", !IO),
+ io__write_string("% Inferred " ++ ChangeStr ++ " detism ",
+ !IO),
mercury_output_det(Detism, !IO),
io__write_string(" for ", !IO),
hlds_out__write_pred_proc_id(!.ModuleInfo,
@@ -220,8 +216,6 @@
;
true
),
- !:Changed = changed
- ),
list__append(ProcMsgs, !Msgs),
global_inference_single_pass(PredProcs, Debug, !ModuleInfo, !Msgs,
!Changed, !IO).
@@ -237,7 +231,8 @@
%-----------------------------------------------------------------------------%
-det_infer_proc(PredId, ProcId, !ModuleInfo, Globals, Detism0, Detism, Msgs) :-
+det_infer_proc(PredId, ProcId, !ModuleInfo, Globals, Detism0, Detism,
+ !:Msgs) :-
% Get the proc_info structure for this procedure
module_info_preds(!.ModuleInfo, Preds0),
@@ -276,7 +271,7 @@
det_info_init(!.ModuleInfo, VarTypes, PredId, ProcId, Globals,
DetInfo),
det_infer_goal(Goal0, InstMap0, SolnContext, DetInfo,
- Goal, Detism1, Msgs),
+ Goal, Detism1, !:Msgs),
% Take the worst of the old and new detisms.
% This is needed to prevent loops on p :- not(p)
@@ -295,6 +290,17 @@
proc_info_eval_method(Proc0, EvalMethod),
Detism = eval_method_change_determinism(EvalMethod, Detism2),
+ (
+ proc_info_has_io_state_pair(!.ModuleInfo, Proc,
+ _InArgNum, _OutArgNum),
+ determinism_to_code_model(Detism, CodeModel),
+ CodeModel \= model_det
+ ->
+ !:Msgs = [has_io_state_but_not_det(PredId, ProcId) | !.Msgs]
+ ;
+ true
+ ),
+
% Save the newly inferred information
proc_info_set_goal(Goal, Proc0, Proc1),
proc_info_set_inferred_determinism(Detism, Proc1, Proc),
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.85
diff -u -r1.85 det_report.m
--- compiler/det_report.m 5 Apr 2004 05:06:46 -0000 1.85
+++ compiler/det_report.m 14 May 2004 08:30:25 -0000
@@ -60,7 +60,7 @@
; par_conj_not_det(determinism, pred_id, proc_id,
hlds_goal_info, list(hlds_goal))
; pragma_c_code_without_det_decl(pred_id, proc_id)
- .
+ ; has_io_state_but_not_det(pred_id, proc_id).
:- type seen_call_id
---> seen_call(pred_id, proc_id)
@@ -212,8 +212,7 @@
% warnings about unimplemented
% predicates.
(
- WarnAboutInferredErroneous = yes,
- true
+ WarnAboutInferredErroneous = yes
;
WarnAboutInferredErroneous = no,
InferredDetism \= erroneous
@@ -261,26 +260,27 @@
module_info_set_pred_info(PredId, PredInfo, !ModuleInfo)
;
proc_info_context(ProcInfo0, Context),
- prog_out__write_context(Context, !IO),
- EvalMethodS = eval_method_to_string(EvalMethod),
- io__write_string("Error: `pragma ", !IO),
- io__write_string(EvalMethodS, !IO),
- io__write_string("' declaration not allowed for procedure\n",
- !IO),
- prog_out__write_context(Context, !IO),
- io__write_string(" with determinism `", !IO),
- mercury_output_det(InferredDetism, !IO),
- io__write_string("'.\n", !IO),
+ write_error_pieces(Context, 0,
+ [words("Error: `pragma "
+ ++ eval_method_to_string(EvalMethod)
+ ++ "'"),
+ words("declaration not allowed for"),
+ words("with determinism `"
+ ++ determinism_to_string(InferredDetism)
+ ++ "'.")], !IO),
globals__io_lookup_bool_option(verbose_errors, VerboseErrors,
!IO),
- ( VerboseErrors = yes ->
- io__write_string("\tThe pragma requested is only " ++
- "valid for the folowing determinism(s):\n",
- !IO),
- solutions(get_valid_dets(EvalMethod), Sols),
- print_dets(Sols, !IO)
+ (
+ VerboseErrors = yes,
+ solutions(get_valid_dets(EvalMethod), Detisms),
+ DetismStrs = list__map(determinism_to_string, Detisms),
+ list_to_pieces(DetismStrs, DetismPieces),
+ write_error_pieces_not_first_line(Context, 0,
+ [words("The pragma requested is only valid"),
+ words("for the following determinism(s):") |
+ DetismPieces], !IO)
;
- true
+ VerboseErrors = no
),
module_info_incr_errors(!ModuleInfo)
).
@@ -305,15 +305,6 @@
determinism(erroneous).
determinism(failure).
-:- pred print_dets(list(determinism)::in, io::di, io::uo) is det.
-
-print_dets([]) --> [].
-print_dets([D|Rest]) -->
- io__write_string("\t\t"),
- mercury_output_det(D),
- io__nl,
- print_dets(Rest).
-
:- pred check_determinism_of_main(pred_id::in, proc_id::in,
pred_info::in, proc_info::in, module_info::in, module_info::out,
io::di, io::uo) is det.
@@ -334,9 +325,9 @@
DeclaredDetism \= cc_multidet
->
proc_info_context(ProcInfo, Context1),
- prog_out__write_context(Context1, !IO),
- io__write_string(
- "Error: main/2 must be `det' or `cc_multi'.\n", !IO),
+ write_error_pieces(Context1, 0,
+ [words("Error: main/2 must be " ++
+ "`det' or `cc_multi'.")], !IO),
module_info_incr_errors(!ModuleInfo)
;
true
@@ -373,7 +364,8 @@
% ... then it is an error.
proc_info_context(ProcInfo, FuncContext),
proc_info_inst_varset(ProcInfo, InstVarSet),
- describe_one_pred_name_mode(!.ModuleInfo, PredId, InstVarSet,
+ describe_one_pred_name_mode(!.ModuleInfo,
+ should_not_module_qualify, PredId, InstVarSet,
PredArgModes, PredModeDesc),
Pieces = [words("Error: invalid determinism for"),
fixed(PredModeDesc ++ ":"), nl,
@@ -423,23 +415,21 @@
:- pred report_determinism_problem(pred_id::in, proc_id::in, module_info::in,
string::in, determinism::in, determinism::in, io::di, io::uo) is det.
-report_determinism_problem(PredId, ModeId, ModuleInfo, Message,
- DeclaredDetism, InferredDetism) -->
- globals__io_lookup_bool_option(halt_at_warn, HaltAtWarn),
- ( { HaltAtWarn = yes } ->
- io__set_exit_status(1)
- ;
- []
- ),
- report_pred_proc_id(ModuleInfo, PredId, ModeId, no, Context),
- prog_out__write_context(Context),
- io__write_string(Message),
- prog_out__write_context(Context),
- io__write_string(" Declared `"),
- hlds_out__write_determinism(DeclaredDetism),
- io__write_string("', inferred `"),
- hlds_out__write_determinism(InferredDetism),
- io__write_string("'.\n").
+report_determinism_problem(PredId, ProcId, ModuleInfo, Message,
+ DeclaredDetism, InferredDetism, !IO) :-
+ record_warning(!IO),
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_context(ProcInfo, Context),
+ describe_one_proc_name_mode(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), Desc),
+ Pieces = [words("In " ++ Desc ++ ":"), nl,
+ words(Message), nl,
+ words("Declared `"
+ ++ determinism_to_string(DeclaredDetism)
+ ++ "', inferred `"
+ ++ determinism_to_string(InferredDetism)
+ ++ "'.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
%-----------------------------------------------------------------------------%
@@ -685,14 +675,13 @@
%-----------------------------------------------------------------------------%
-:- pred report_generic_call_context(prog_context::in,
- generic_call::in, io::di, io::uo) is det.
+:- pred report_generic_call_context(prog_context::in, generic_call::in,
+ io::di, io::uo) is det.
-report_generic_call_context(Context, CallType) -->
- prog_out__write_context(Context),
- io__write_string(" "),
- { hlds_goal__generic_call_id(CallType, CallId) },
- hlds_out__write_call_id(CallId).
+report_generic_call_context(Context, CallType, !IO) :-
+ hlds_goal__generic_call_id(CallType, CallId),
+ write_error_pieces(Context, 0, [words(call_id_to_string(CallId))],
+ !IO).
%-----------------------------------------------------------------------------%
@@ -895,10 +884,11 @@
% generated type-specific unification predicate
% should have a unify_context
CallUnifyContext = no,
- prog_out__write_context(Context, !IO),
- io__write_string(" Some weird unification " ++
- "(or explicit call to a type-specific " ++
- "unify predicate?)", !IO)
+ write_error_pieces(Context, 0,
+ [words("Some weird unification"
+ ++ "(or explicit call to a"
+ ++ "type-specific unify predicate?)")],
+ !IO)
)
;
(
@@ -1017,8 +1007,7 @@
module_info::in, int::in, int::out, int::in, int::out,
io::di, io::uo) is det.
-det_report_msgs_2([], _, _, _ModuleInfo,
- !WarnCnt, !ErrCnt, !IO).
+det_report_msgs_2([], _, _, _ModuleInfo, !WarnCnt, !ErrCnt, !IO).
det_report_msgs_2([Msg | Msgs], WarnSimple, WarnCalls, ModuleInfo,
!WarnCnt, !ErrCnt, !IO) :-
det_msg_get_type(Msg, MsgType),
@@ -1067,6 +1056,7 @@
det_msg_get_type(error_in_lambda(_, _, _, _, _, _), error).
det_msg_get_type(par_conj_not_det(_, _, _, _, _), error).
det_msg_get_type(pragma_c_code_without_det_decl(_, _), error).
+det_msg_get_type(has_io_state_but_not_det(_, _), error).
det_msg_is_any_mode_msg(multidet_disj(_, _), all_modes).
det_msg_is_any_mode_msg(det_disj(_, _), all_modes).
@@ -1089,335 +1079,360 @@
det_msg_is_any_mode_msg(error_in_lambda(_, _, _, _, _, _), any_mode).
det_msg_is_any_mode_msg(par_conj_not_det(_, _, _, _, _), any_mode).
det_msg_is_any_mode_msg(pragma_c_code_without_det_decl(_, _), any_mode).
+det_msg_is_any_mode_msg(has_io_state_but_not_det(_, _), any_mode).
:- pred det_report_msg(det_msg::in, module_info::in, io::di, io::uo) is det.
-det_report_msg(multidet_disj(Context, DisjunctContexts), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the disjunction with arms on lines "),
- det_report_context_lines(DisjunctContexts, yes),
- io__write_string("\n"),
- prog_out__write_context(Context),
- io__write_string(" has no outputs, but can succeed more than once.\n").
-det_report_msg(det_disj(Context, DisjunctContexts), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the disjunction with arms on lines "),
- det_report_context_lines(DisjunctContexts, yes),
- io__write_string("\n"),
- prog_out__write_context(Context),
- io__write_string(" will succeed exactly once.\n").
-det_report_msg(semidet_disj(Context, DisjunctContexts), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the disjunction with arms on lines "),
- det_report_context_lines(DisjunctContexts, yes),
- io__write_string("\n"),
- prog_out__write_context(Context),
- io__write_string(" is semidet, yet it has an output.\n").
-det_report_msg(zero_soln_disj(Context, DisjunctContexts), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the disjunction with arms on lines "),
- det_report_context_lines(DisjunctContexts, yes),
- io__write_string("\n"),
- prog_out__write_context(Context),
- io__write_string(" cannot succeed.\n").
-det_report_msg(zero_soln_disjunct(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: this disjunct will never have any solutions.\n").
-det_report_msg(ite_cond_cannot_fail(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the condition of this if-then-else cannot fail.\n").
-det_report_msg(ite_cond_cannot_succeed(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the condition of this if-then-else cannot succeed.\n").
-det_report_msg(negated_goal_cannot_fail(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the negated goal cannot fail.\n").
-det_report_msg(negated_goal_cannot_succeed(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: the negated goal cannot succeed.\n").
-det_report_msg(goal_cannot_succeed(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: this goal cannot succeed.\n"),
- globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
- ( { VerboseErrors = yes } ->
- io__write_string(
-"\tThe compiler will optimize away this goal, replacing it with `fail'.
-\tTo disable this optimization, use the `--fully-strict' option.\n")
+det_report_msg(multidet_disj(Context, DisjunctContexts), _, !IO) :-
+ Pieces = [words("Warning: the disjunction with arms on lines"),
+ words(det_report_context_lines(DisjunctContexts)),
+ words("has no outputs, but can succeed more than once.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(det_disj(Context, DisjunctContexts), _, !IO) :-
+ Pieces = [words("Warning: the disjunction with arms on lines"),
+ words(det_report_context_lines(DisjunctContexts)),
+ words("will succeed exactly once.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(semidet_disj(Context, DisjunctContexts), _, !IO) :-
+ Pieces = [words("Warning: the disjunction with arms on lines"),
+ words(det_report_context_lines(DisjunctContexts)),
+ words("is semidet, yet it has an output.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(zero_soln_disj(Context, DisjunctContexts), _, !IO) :-
+ Pieces = [words("Warning: the disjunction with arms on lines"),
+ words(det_report_context_lines(DisjunctContexts)),
+ words("cannot succeed.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(zero_soln_disjunct(Context), _, !IO) :-
+ Pieces = [words("Warning: this disjunct"),
+ words("will never have any solutions.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(ite_cond_cannot_fail(Context), _, !IO) :-
+ Pieces = [words("Warning: the condition of this if-then-else"),
+ words("cannot fail.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(ite_cond_cannot_succeed(Context), _, !IO) :-
+ Pieces = [words("Warning: the condition of this if-then-else"),
+ words("cannot succeed.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(negated_goal_cannot_fail(Context), _, !IO) :-
+ Pieces = [words("Warning: the negated goal cannot fail.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(negated_goal_cannot_succeed(Context), _, !IO) :-
+ Pieces = [words("Warning: the negated goal cannot succeed.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(goal_cannot_succeed(Context), _, !IO) :-
+ Pieces0 = [words("Warning: this goal cannot succeed.")],
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ Pieces1 = [words("The compiler will optimize away this goal,"),
+ words("replacing it with `fail'."),
+ words("To disable this optimization, use "),
+ words("the `--fully-strict' option.")],
+ Pieces = Pieces0 ++ Pieces1
;
- []
- ).
-det_report_msg(det_goal_has_no_outputs(Context), _) -->
- prog_out__write_context(Context),
- io__write_string("Warning: det goal has no outputs.\n"),
- globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
- ( { VerboseErrors = yes } ->
- io__write_string(
-"\tThe compiler will optimize away this goal, replacing it with `true'.
-\tTo disable this optimization, use the `--fully-strict' option.\n")
+ VerboseErrors = no,
+ Pieces = Pieces0
+ ),
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(det_goal_has_no_outputs(Context), _, !IO) :-
+ Pieces0 = [words("Warning: det goal has no outputs.")],
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ Pieces1 = [words("The compiler will optimize away this goal,"),
+ words("replacing it with `true'."),
+ words("To disable this optimization, use "),
+ words("the `--fully-strict' option.")],
+ Pieces = Pieces0 ++ Pieces1
;
- []
- ).
-det_report_msg(warn_obsolete(PredId, Context), ModuleInfo) -->
- prog_out__write_context(Context),
- io__write_string("Warning: call to obsolete "),
- hlds_out__write_pred_id(ModuleInfo, PredId),
- io__write_string(".\n").
-det_report_msg(warn_infinite_recursion(Context), _ModuleInfo) -->
-/*
-% it would be better if we supplied more information
-% than just the line number.
- prog_out__write_context(Context),
- io__write_string("In "),
- hlds_out__write_pred_id(ModuleInfo, PredId),
- io__write_string(":\n"),
-*/
- prog_out__write_context(Context),
- io__write_string(
- "Warning: recursive call will lead to infinite recursion.\n"),
- globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
- ( { VerboseErrors = yes } ->
- io__write_string(
-"\tIf this recursive call is executed, the procedure will call itself
-\twith exactly the same input arguments, leading to infinite recursion.\n")
+ VerboseErrors = no,
+ Pieces = Pieces0
+ ),
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(warn_obsolete(PredId, Context), ModuleInfo, !IO) :-
+ describe_one_pred_name(ModuleInfo, should_module_qualify, PredId,
+ PredDesc),
+ Pieces = [words("Warning: call to obsolete "),
+ fixed(PredDesc ++ ".")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(warn_infinite_recursion(Context), _ModuleInfo, !IO) :-
+ % it would be better if we supplied more information than just
+ % the line number, e.g. we should print the name of the containing
+ % predicate.
+ Pieces0 = [words("Warning: recursive call will lead"),
+ words("to infinite recursion.")],
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ Pieces1 = [words("If this recursive call is executed,"),
+ words("the procedure will call itself"),
+ words("with exactly the same input arguments,"),
+ words("leading to infinite recursion.")],
+ Pieces = Pieces0 ++ Pieces1
;
- []
- ).
-det_report_msg(duplicate_call(SeenCall, PrevContext, Context), ModuleInfo) -->
- prog_out__write_context(Context),
- io__write_string("Warning: redundant "),
- det_report_seen_call_id(SeenCall, ModuleInfo),
- io__write_string(".\n"),
- prog_out__write_context(PrevContext),
- io__write_string("Here is the previous "),
- det_report_seen_call_id(SeenCall, ModuleInfo),
- io__write_string(".\n").
+ VerboseErrors = no,
+ Pieces = Pieces0
+ ),
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(duplicate_call(SeenCall, PrevContext, Context), ModuleInfo,
+ !IO) :-
+ CallPieces = det_report_seen_call_id(ModuleInfo, SeenCall),
+ CurPieces = [words("Warning: redundant") |
+ append_punctuation(CallPieces, '.')],
+ PrevPieces = [words("Here is the previous") |
+ append_punctuation(CallPieces, '.')],
+ write_error_pieces(Context, 0, CurPieces, !IO),
+ write_error_pieces(PrevContext, 0, PrevPieces, !IO).
det_report_msg(cc_unify_can_fail(GoalInfo, Var, Type, VarSet, GoalContext),
- _ModuleInfo) -->
- { goal_info_get_context(GoalInfo, Context) },
- { First0 = yes },
- ( { GoalContext = switch },
- prog_out__write_context(Context),
- io__write_string("In switch on variable `"),
- mercury_output_var(Var, VarSet, no),
- io__write_string("':\n"),
- { First = no }
- ; { GoalContext = unify(UnifyContext) },
- hlds_out__write_unify_context(First0, UnifyContext, Context,
- First)
- ),
- prog_out__write_context(Context),
- ( { First = yes } ->
- io__write_string("Error: ")
- ;
- io__write_string(" error: ")
- ),
- io__write_string("unification for non-canonical type\n"),
- prog_out__write_context(Context),
- io__write_string(" `"),
- ( { type_to_ctor_and_args(Type, TypeCtor, _TypeArgs) } ->
- hlds_out__write_type_ctor(TypeCtor)
- ;
- { error("det_report_message: type_to_ctor_and_args failed") }
- ),
- io__write_string("'\n"),
- prog_out__write_context(Context),
- io__write_string(" is not guaranteed to succeed.\n"),
- globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
- ( { VerboseErrors = yes } ->
- io__write_strings([
-" Since the type has a user-defined equality predicate, I must\n",
-" presume that there is more than one possible concrete\n",
-" representation for each abstract value of this type. The success\n",
-" of this unification might depend on the choice of concrete\n",
-" representation. Figuring out whether there is a solution to\n",
-" this unification would require backtracking over all possible\n",
-" representations, but I'm not going to do that implicitly.\n",
-" (If that's really what you want, you must do it explicitly.)\n"
- ])
+ _ModuleInfo, !IO) :-
+ goal_info_get_context(GoalInfo, Context),
+ (
+ GoalContext = switch,
+ VarStr = mercury_var_to_string(Var, VarSet, no),
+ Pieces0 = [words("In switch on variable `" ++ VarStr ++ "':"),
+ nl]
;
- []
+ GoalContext = unify(UnifyContext),
+ hlds_out__unify_context_to_pieces(UnifyContext, [], Pieces0)
),
- io__set_exit_status(1).
+ ( type_to_ctor_and_args(Type, TypeCtor, _TypeArgs) ->
+ TypeCtorStr = hlds_out__type_ctor_to_string(TypeCtor)
+ ;
+ error("det_report_msg: type_to_ctor_and_args failed")
+ ),
+ (
+ Pieces0 = [],
+ ErrorMsg = "Error:"
+ ;
+ Pieces0 = [_ | _],
+ ErrorMsg = "error:"
+ ),
+ Pieces1 = [words(ErrorMsg),
+ words("unification for non-canonical type"),
+ words("`" ++ TypeCtorStr ++ "'"),
+ words("is not guaranteed to succeed.")],
+ Pieces = Pieces0 ++ Pieces1,
+ write_error_pieces(Context, 0, Pieces, !IO),
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ VerbosePieces = [words("Since the type has a user-defined"),
+ words("equality predicate, I must presume that"),
+ words("there is more than one possible concrete"),
+ words("representation for each abstract value"),
+ words("of this type. The success of this unification"),
+ words("might depend on the choice of concrete"),
+ words("representation. Figuring out whether there is"),
+ words("a solution to this unification would require"),
+ words("backtracking over all possible"),
+ words("representations, but I'm not going to do that"),
+ words("implicitly. (If that's really what you want,"),
+ words("you must do it explicitly.")],
+ write_error_pieces_not_first_line(Context, 0, VerbosePieces,
+ !IO)
+ ;
+ VerboseErrors = no
+ ).
det_report_msg(cc_unify_in_wrong_context(GoalInfo, Var, Type, VarSet,
- GoalContext), _ModuleInfo) -->
- { goal_info_get_context(GoalInfo, Context) },
- { First0 = yes },
- ( { GoalContext = switch },
- prog_out__write_context(Context),
- io__write_string("In switch on variable `"),
- mercury_output_var(Var, VarSet, no),
- io__write_string("':\n"),
- { First = no }
- ; { GoalContext = unify(UnifyContext) },
- hlds_out__write_unify_context(First0, UnifyContext, Context,
- First)
- ),
- prog_out__write_context(Context),
- ( { First = yes } ->
- io__write_string("Error: ")
- ;
- io__write_string(" error: ")
- ),
- io__write_string("unification for non-canonical type\n"),
- prog_out__write_context(Context),
- io__write_string(" `"),
- ( { type_to_ctor_and_args(Type, TypeCtor, _TypeArgs) } ->
- hlds_out__write_type_ctor(TypeCtor)
- ;
- { error("det_report_message: type_to_ctor_and_args failed") }
- ),
- io__write_string("'\n"),
- prog_out__write_context(Context),
- io__write_string(
- " occurs in a context which requires all solutions.\n"),
- globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
- ( { VerboseErrors = yes } ->
- io__write_strings([
-" Since the type has a user-defined equality predicate, I must\n",
-" presume that there is more than one possible concrete\n",
-" representation for each abstract value of this type. The results\n",
-" of this unification might depend on the choice of concrete\n",
-" representation. Finding all possible solutions to this\n",
-" unification would require backtracking over all possible\n",
-" representations, but I'm not going to do that implicitly.\n",
-" (If that's really what you want, you must do it explicitly.)\n"
- ])
+ GoalContext), _ModuleInfo, !IO) :-
+ goal_info_get_context(GoalInfo, Context),
+ (
+ GoalContext = switch,
+ VarStr = mercury_var_to_string(Var, VarSet, no),
+ Pieces0 = [words("In switch on variable `" ++ VarStr ++ "':"),
+ nl]
;
- []
+ GoalContext = unify(UnifyContext),
+ hlds_out__unify_context_to_pieces(UnifyContext, [], Pieces0)
),
- io__set_exit_status(1).
+ ( type_to_ctor_and_args(Type, TypeCtor, _TypeArgs) ->
+ TypeCtorStr = hlds_out__type_ctor_to_string(TypeCtor)
+ ;
+ error("det_report_msg: type_to_ctor_and_args failed")
+ ),
+ (
+ Pieces0 = [],
+ ErrorMsg = "Error:"
+ ;
+ Pieces0 = [_ | _],
+ ErrorMsg = "error:"
+ ),
+ Pieces1 = [words(ErrorMsg),
+ words("unification for non-canonical type"),
+ words("`" ++ TypeCtorStr ++ "'"),
+ words("occurs in a context which requires all solutions.")],
+ Pieces = Pieces0 ++ Pieces1,
+ write_error_pieces(Context, 0, Pieces, !IO),
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ VerbosePieces = [words("Since the type has a user-defined"),
+ words("equality predicate, I must presume that"),
+ words("there is more than one possible concrete"),
+ words("representation for each abstract value"),
+ words("of this type. The results of this unification"),
+ words("might depend on the choice of concrete"),
+ words("representation. Finding all possible"),
+ words("solutions to this unification would require"),
+ words("backtracking over all possible"),
+ words("representations, but I'm not going to do that"),
+ words("implicitly. (If that's really what you want,"),
+ words("you must do it explicitly.")],
+ write_error_pieces_not_first_line(Context, 0, VerbosePieces,
+ !IO)
+ ;
+ VerboseErrors = no
+ ).
det_report_msg(cc_pred_in_wrong_context(GoalInfo, Detism, PredId, _ModeId),
- ModuleInfo) -->
- { goal_info_get_context(GoalInfo, Context) },
- prog_out__write_context(Context),
- io__write_string("Error: call to "),
- hlds_out__write_pred_id(ModuleInfo, PredId),
- io__write_string(" with determinism `"),
- mercury_output_det(Detism),
- io__write_string("'\n"),
- prog_out__write_context(Context),
- io__write_string(" occurs in a context which requires all solutions.\n"),
- io__set_exit_status(1).
+ ModuleInfo, !IO) :-
+ goal_info_get_context(GoalInfo, Context),
+ describe_one_pred_name(ModuleInfo, should_not_module_qualify, PredId,
+ PredDesc),
+ DetStr = mercury_det_to_string(Detism),
+ Pieces = [words("Error: call to"),
+ fixed(PredDesc),
+ words("with determinism `" ++ DetStr ++ "'"),
+ words("occurs in a context which requires all solutions.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
det_report_msg(higher_order_cc_pred_in_wrong_context(GoalInfo, Detism),
- _ModuleInfo) -->
- { goal_info_get_context(GoalInfo, Context) },
- prog_out__write_context(Context),
- io__write_string("Error: higher-order call to predicate with determinism `"),
- mercury_output_det(Detism),
- io__write_string("'\n"),
- prog_out__write_context(Context),
- io__write_string(" occurs in a context which requires all solutions.\n"),
- io__set_exit_status(1).
+ _ModuleInfo, !IO) :-
+ goal_info_get_context(GoalInfo, Context),
+ DetStr = mercury_det_to_string(Detism),
+ Pieces = [words("Error: higher-order call to predicate with"),
+ words("determinism `" ++ DetStr ++ "'"),
+ words("occurs in a context which requires all solutions.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
det_report_msg(error_in_lambda(DeclaredDetism, InferredDetism, Goal, GoalInfo,
- PredId, ProcId), ModuleInfo) -->
- report_pred_proc_id(ModuleInfo, PredId, ProcId, no, _ProcContext),
- { goal_info_get_context(GoalInfo, Context) },
- prog_out__write_context(Context),
- io__write_string("Determinism error in lambda expression.\n"),
- prog_out__write_context(Context),
- io__write_string(" Declared `"),
- hlds_out__write_determinism(DeclaredDetism),
- io__write_string("', inferred `"),
- hlds_out__write_determinism(InferredDetism),
- io__write_string("'.\n"),
- globals__io_get_globals(Globals),
- { module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo) },
- { proc_info_vartypes(ProcInfo, VarTypes) },
- { det_info_init(ModuleInfo, VarTypes, PredId, ProcId, Globals,
- DetInfo) },
- det_diagnose_goal(Goal, DeclaredDetism, [], DetInfo, _),
- io__set_exit_status(1).
+ PredId, ProcId), ModuleInfo, !IO) :-
+ describe_one_proc_name_mode(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), Desc),
+ goal_info_get_context(GoalInfo, Context),
+ write_error_pieces(Context, 0,
+ [words("In " ++ Desc ++ ":"), nl,
+ words("Determinism error in lambda expression."), nl,
+ words("Declared `"
+ ++ determinism_to_string(DeclaredDetism)
+ ++ "', inferred `"
+ ++ determinism_to_string(InferredDetism)
+ ++ "'.")], !IO),
+ globals__io_get_globals(Globals, !IO),
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_vartypes(ProcInfo, VarTypes),
+ det_info_init(ModuleInfo, VarTypes, PredId, ProcId, Globals,
+ DetInfo),
+ det_diagnose_goal(Goal, DeclaredDetism, [], DetInfo, _, !IO).
det_report_msg(par_conj_not_det(InferredDetism, PredId,
- ProcId, GoalInfo, Goals), ModuleInfo) -->
- { goal_info_get_context(GoalInfo, Context) },
- prog_out__write_context(Context),
- { determinism_components(InferredDetism, CanFail, MaxSoln) },
+ ProcId, GoalInfo, Goals), ModuleInfo, !IO) :-
+ goal_info_get_context(GoalInfo, Context),
+ determinism_components(InferredDetism, CanFail, MaxSoln),
(
- { CanFail \= cannot_fail }
+ CanFail \= cannot_fail
->
- io__write_string("Error: parallel conjunct may fail.\n")
+ First = "Error: parallel conjunct may fail."
;
- { MaxSoln = at_most_many }
+ MaxSoln = at_most_many
->
- prog_out__write_context(Context),
- io__write_string("Error: parallel conjunct may have multiple solutions.\n")
+ First = "Error: parallel conjunct may have multiple solutions."
;
- { error("strange determinism error for parallel conjunction") }
+ error("strange determinism error for parallel conjunction")
),
- prog_out__write_context(Context),
- io__write_string(
- " The current implementation supports only single-solution\n"
- ),
- prog_out__write_context(Context),
- io__write_string(" non-failing parallel conjunctions.\n"),
- globals__io_get_globals(Globals),
- { module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo) },
- { proc_info_vartypes(ProcInfo, VarTypes) },
- { det_info_init(ModuleInfo, VarTypes, PredId, ProcId, Globals,
- DetInfo) },
- det_diagnose_conj(Goals, det, [], DetInfo, _),
- io__set_exit_status(1).
+ Rest = "The current implementation supports only single-solution"
+ ++ "non-failing parallel conjunctions.",
+ write_error_pieces(Context, 0, [words(First), words(Rest)], !IO),
+ globals__io_get_globals(Globals, !IO),
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_vartypes(ProcInfo, VarTypes),
+ det_info_init(ModuleInfo, VarTypes, PredId, ProcId, Globals,
+ DetInfo),
+ det_diagnose_conj(Goals, det, [], DetInfo, _, !IO).
det_report_msg(pragma_c_code_without_det_decl(PredId, ProcId),
- ModuleInfo) -->
- report_pred_proc_id(ModuleInfo, PredId, ProcId, no, Context),
- prog_out__write_context(Context),
- io__write_string(" error: `:- pragma c_code(...)' for a procedure"),
- io__nl,
- prog_out__write_context(Context),
- io__write_string(" without a determinism declaration."),
- io__nl.
+ ModuleInfo, !IO) :-
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_context(ProcInfo, Context),
+ describe_one_proc_name_mode(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), Desc),
+ Pieces = [words("In " ++ Desc ++ ":"), nl,
+ words("error: `:- pragma c_code(...)' for a procedure"),
+ words("without a determinism declaration.")],
+ write_error_pieces(Context, 0, Pieces, !IO).
+det_report_msg(has_io_state_but_not_det(PredId, ProcId), ModuleInfo, !IO) :-
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_context(ProcInfo, Context),
+ describe_one_proc_name_mode(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), Desc),
+ Pieces = [words("In " ++ Desc ++ ":"), nl,
+ words("error: invalid determinism for a predicate"),
+ words("with I/O state arguments.")],
+ write_error_pieces(Context, 0, Pieces, !IO),
+ globals__io_lookup_bool_option(verbose_errors, VerboseErrors, !IO),
+ (
+ VerboseErrors = yes,
+ VerbosePieces = [words("Valid determinisms are "),
+ words("det, cc_multi and erroneous.")],
+ write_error_pieces_not_first_line(Context, 0, VerbosePieces,
+ !IO)
+ ;
+ VerboseErrors = no
+ ).
%-----------------------------------------------------------------------------%
-:- pred det_report_seen_call_id(seen_call_id::in, module_info::in,
- io::di, io::uo) is det.
+:- func det_report_seen_call_id(module_info, seen_call_id)
+ = list(format_component).
-det_report_seen_call_id(SeenCall, ModuleInfo) -->
+det_report_seen_call_id(ModuleInfo, SeenCall) = Pieces :-
(
- { SeenCall = seen_call(PredId, _) },
- io__write_string("call to "),
- hlds_out__write_pred_id(ModuleInfo, PredId)
+ SeenCall = seen_call(PredId, _),
+ describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredDesc),
+ Pieces = [words("call to"), fixed(PredDesc)]
;
- { SeenCall = higher_order_call },
- io__write_string("higher-order call")
+ SeenCall = higher_order_call,
+ Pieces = [words("higher-order call")]
).
%-----------------------------------------------------------------------------%
-:- pred det_report_context_lines(list(prog_context)::in, bool::in,
- io::di, io::uo) is det.
+:- func det_report_context_lines(list(prog_context)) = string.
-det_report_context_lines([], _) --> [].
-det_report_context_lines([Context | Contexts], First) -->
- { term__context_line(Context, Line) },
- ( { First = yes } ->
- []
- ; { Contexts = [] } ->
- io__write_string(" and ")
- ;
- io__write_string(", ")
- ),
- io__write_int(Line),
- det_report_context_lines(Contexts, no).
+det_report_context_lines(Contexts) = det_report_context_lines_2(Contexts, yes).
+
+:- func det_report_context_lines_2(list(prog_context), bool) = string.
+
+det_report_context_lines_2([], _) = "".
+det_report_context_lines_2([Context | Contexts], First) = Str :-
+ term__context_line(Context, Line),
+ ( First = yes ->
+ Punct = ""
+ ; Contexts = [] ->
+ Punct = " and "
+ ;
+ Punct = ", "
+ ),
+ int_to_string(Line, This),
+ Later = det_report_context_lines_2(Contexts, no),
+ Str = Punct ++ This ++ Later.
%-----------------------------------------------------------------------------%
:- type options_to_restore == assoc_list(option, option_data).
-disable_det_warnings(OptionsToRestore) -->
- globals__io_lookup_option(warn_simple_code, WarnSimple),
+disable_det_warnings(OptionsToRestore, !IO) :-
+ globals__io_lookup_option(warn_simple_code, WarnSimple, !IO),
globals__io_lookup_option(warn_det_decls_too_lax,
- WarnDeclsTooLax),
- globals__io_set_option(warn_simple_code, bool(no)),
- globals__io_set_option(warn_det_decls_too_lax, bool(no)),
- { OptionsToRestore = [
+ WarnDeclsTooLax, !IO),
+ globals__io_set_option(warn_simple_code, bool(no), !IO),
+ globals__io_set_option(warn_det_decls_too_lax, bool(no), !IO),
+ OptionsToRestore = [
warn_simple_code - WarnSimple,
warn_det_decls_too_lax - WarnDeclsTooLax
- ] }.
+ ].
-restore_det_warnings(OptionsToRestore) -->
+restore_det_warnings(OptionsToRestore, !IO) :-
list__foldl((pred((Option - Value)::in, di, uo) is det -->
globals__io_set_option(Option, Value)
- ), OptionsToRestore).
+ ), OptionsToRestore, !IO).
%-----------------------------------------------------------------------------%
Index: compiler/globals.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.59
diff -u -r1.59 globals.m
--- compiler/globals.m 10 Feb 2004 12:43:31 -0000 1.59
+++ compiler/globals.m 14 May 2004 08:30:25 -0000
@@ -122,18 +122,17 @@
:- pred globals__get_source_file_map(globals::in, maybe(source_file_map)::out)
is det.
-:- pred globals__set_options(globals::in, option_table::in, globals::out)
+:- pred globals__set_options(option_table::in, globals::in, globals::out)
is det.
-:- pred globals__set_gc_method(globals::in, gc_method::in, globals::out)
+:- pred globals__set_gc_method(gc_method::in, globals::in, globals::out)
is det.
-:- pred globals__set_tags_method(globals::in, tags_method::in, globals::out)
+:- pred globals__set_tags_method(tags_method::in, globals::in, globals::out)
is det.
-:- pred globals__set_trace_level(globals::in, trace_level::in, globals::out)
+:- pred globals__set_trace_level(trace_level::in, globals::in, globals::out)
is det.
:- pred globals__set_trace_level_none(globals::in, globals::out) is det.
-
-:- pred globals__set_source_file_map(globals::in, maybe(source_file_map)::in,
- globals::out) is det.
+:- pred globals__set_source_file_map(maybe(source_file_map)::in,
+ globals::in, globals::out) is det.
:- pred globals__lookup_option(globals::in, option::in, option_data::out)
is det.
@@ -177,69 +176,52 @@
:- pred globals__io_init(option_table::di, compilation_target::in,
gc_method::in, tags_method::in,
termination_norm::in, trace_level::in, trace_suppress_items::in,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_get_target(compilation_target::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
+:- pred globals__io_get_target(compilation_target::out, io::di, io::uo) is det.
:- pred globals__io_get_backend_foreign_languages(list(foreign_language)::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_foreign_language_option(option::in,
- foreign_language::out, io__state::di, io__state::uo) is det.
-
-:- pred globals__io_get_gc_method(gc_method::out,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_get_tags_method(tags_method::out,
- io__state::di, io__state::uo) is det.
+ foreign_language::out, io::di, io::uo) is det.
+:- pred globals__io_get_gc_method(gc_method::out, io::di, io::uo) is det.
+:- pred globals__io_get_tags_method(tags_method::out, io::di, io::uo) is det.
:- pred globals__io_get_termination_norm(termination_norm::out,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_get_trace_level(trace_level::out,
- io__state::di, io__state::uo) is det.
-
+ io::di, io::uo) is det.
+:- pred globals__io_get_trace_level(trace_level::out, io::di, io::uo) is det.
:- pred globals__io_get_trace_suppress(trace_suppress_items::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
-:- pred globals__io_get_globals(globals::out, io__state::di, io__state::uo)
- is det.
+:- pred globals__io_get_globals(globals::out, io::di, io::uo) is det.
-:- pred globals__io_set_globals(globals::di, io__state::di, io__state::uo)
- is det.
+:- pred globals__io_set_globals(globals::di, io::di, io::uo) is det.
:- pred globals__io_set_option(option::in, option_data::in,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_set_gc_method(gc_method::in,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_set_tags_method(tags_method::in,
- io__state::di, io__state::uo) is det.
-
-:- pred globals__io_set_trace_level(trace_level::in,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
-:- pred globals__io_set_trace_level_none(io__state::di, io__state::uo) is det.
+:- pred globals__io_set_gc_method(gc_method::in, io::di, io::uo) is det.
+:- pred globals__io_set_tags_method(tags_method::in, io::di, io::uo) is det.
+:- pred globals__io_set_trace_level(trace_level::in, io::di, io::uo) is det.
+:- pred globals__io_set_trace_level_none(io::di, io::uo) is det.
:- pred globals__io_lookup_option(option::in, option_data::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_bool_option(option::in, bool::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_int_option(option::in, int::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_string_option(option::in, string::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_maybe_string_option(option::in, maybe(string)::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
:- pred globals__io_lookup_accumulating_option(option::in, list(string)::out,
- io__state::di, io__state::uo) is det.
+ io::di, io::uo) is det.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -335,20 +317,19 @@
"invalid foreign_language string")
), LangStrs).
-globals__set_options(Globals, Options, Globals ^ options := Options).
+globals__set_options(Options, Globals, Globals ^ options := Options).
-globals__set_gc_method(Globals, GC_Method,
- Globals ^ gc_method := GC_Method).
+globals__set_gc_method(GC_Method, Globals, Globals ^ gc_method := GC_Method).
-globals__set_tags_method(Globals, Tags_Method,
+globals__set_tags_method(Tags_Method, Globals,
Globals ^ tags_method := Tags_Method).
-globals__set_trace_level(Globals, TraceLevel,
+globals__set_trace_level(TraceLevel, Globals,
Globals ^ trace_level := TraceLevel).
globals__set_trace_level_none(Globals,
Globals ^ trace_level := trace_level_none).
-globals__set_source_file_map(Globals, SourceFileMap,
+globals__set_source_file_map(SourceFileMap, Globals,
Globals ^ source_file_map := SourceFileMap).
globals__lookup_option(Globals, Option, OptionData) :-
@@ -395,7 +376,8 @@
( OptionData = accumulating(Accumulating) ->
Value = Accumulating
;
- error("globals__lookup_accumulating_option: invalid accumulating option")
+ error("globals__lookup_accumulating_option: "
+ ++ "invalid accumulating option")
).
%-----------------------------------------------------------------------------%
@@ -516,7 +498,7 @@
globals__io_get_globals(Globals0),
{ globals__get_options(Globals0, OptionTable0) },
{ map__set(OptionTable0, Option, OptionData, OptionTable) },
- { globals__set_options(Globals0, OptionTable, Globals1) },
+ { globals__set_options(OptionTable, Globals0, Globals1) },
% XXX there is a bit of a design flaw with regard to
% uniqueness and io__set_globals
{ unsafe_promise_unique(Globals1, Globals) },
@@ -524,7 +506,7 @@
globals__io_set_gc_method(GC_Method) -->
globals__io_get_globals(Globals0),
- { globals__set_gc_method(Globals0, GC_Method, Globals1) },
+ { globals__set_gc_method(GC_Method, Globals0, Globals1) },
{ unsafe_promise_unique(Globals1, Globals) },
% XXX there is a bit of a design flaw with regard to
% uniqueness and io__set_globals
@@ -532,7 +514,7 @@
globals__io_set_tags_method(Tags_Method) -->
globals__io_get_globals(Globals0),
- { globals__set_tags_method(Globals0, Tags_Method, Globals1) },
+ { globals__set_tags_method(Tags_Method, Globals0, Globals1) },
{ unsafe_promise_unique(Globals1, Globals) },
% XXX there is a bit of a design flaw with regard to
% uniqueness and io__set_globals
@@ -540,7 +522,7 @@
globals__io_set_trace_level(TraceLevel) -->
globals__io_get_globals(Globals0),
- { globals__set_trace_level(Globals0, TraceLevel, Globals1) },
+ { globals__set_trace_level(TraceLevel, Globals0, Globals1) },
{ unsafe_promise_unique(Globals1, Globals) },
% XXX there is a bit of a design flaw with regard to
% uniqueness and io__set_globals
@@ -558,7 +540,8 @@
{ convert_foreign_language(String, ForeignLang0) ->
ForeignLang = ForeignLang0
;
- error("globals__io_lookup_foreign_language_option: invalid foreign_language option")
+ error("globals__io_lookup_foreign_language_option: "
+ ++ "invalid foreign_language option")
}.
globals__io_get_backend_foreign_languages(ForeignLangs) -->
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.202
diff -u -r1.202 handle_options.m
--- compiler/handle_options.m 19 Mar 2004 10:19:20 -0000 1.202
+++ compiler/handle_options.m 14 May 2004 08:30:26 -0000
@@ -1127,10 +1127,10 @@
( { MaybeStdLibDir = yes(StdLibDir) } ->
globals__io_get_globals(Globals2),
{ globals__get_options(Globals2, OptionTable2) },
- { globals__set_options(Globals2,
+ { globals__set_options(
option_table_add_mercury_library_directory(
OptionTable2, StdLibDir),
- Globals3) },
+ Globals2, Globals3) },
{ unsafe_promise_unique(Globals3, Globals4) },
globals__io_set_globals(Globals4),
Index: compiler/hlds_error_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_error_util.m,v
retrieving revision 1.2
diff -u -r1.2 hlds_error_util.m
--- compiler/hlds_error_util.m 5 Apr 2004 05:06:48 -0000 1.2
+++ compiler/hlds_error_util.m 14 May 2004 08:30:26 -0000
@@ -24,27 +24,34 @@
:- import_module assoc_list, list, std_util.
- % Predicates to convert a predicate names to strings.
+ % Predicates to convert a predicate and procedure names to strings.
-:- pred describe_one_pred_name(module_info::in, pred_id::in,
- string::out) is det.
+:- type should_module_qualify
+ ---> should_module_qualify
+ ; should_not_module_qualify.
-:- pred describe_one_pred_name_mode(module_info::in, pred_id::in,
- inst_varset::in, list(mode)::in, string::out) is det.
+:- pred describe_one_pred_name(module_info::in, should_module_qualify::in,
+ pred_id::in, string::out) is det.
-:- pred describe_several_pred_names(module_info::in,
+:- pred describe_one_pred_name_mode(module_info::in, should_module_qualify::in,
+ pred_id::in, inst_varset::in, list(mode)::in, string::out) is det.
+
+:- pred describe_several_pred_names(module_info::in, should_module_qualify::in,
list(pred_id)::in, list(format_component)::out) is det.
-:- pred describe_one_proc_name(module_info::in, pred_proc_id::in,
- string::out) is det.
+:- pred describe_one_proc_name(module_info::in, should_module_qualify::in,
+ pred_proc_id::in, string::out) is det.
+
+:- pred describe_one_proc_name_mode(module_info::in, should_module_qualify::in,
+ pred_proc_id::in, string::out) is det.
-:- pred describe_several_proc_names(module_info::in,
+:- pred describe_several_proc_names(module_info::in, should_module_qualify::in,
list(pred_proc_id)::in, list(format_component)::out) is det.
-:- pred describe_one_call_site(module_info::in,
+:- pred describe_one_call_site(module_info::in, should_module_qualify::in,
pair(pred_proc_id, prog_context)::in, string::out) is det.
-:- pred describe_several_call_sites(module_info::in,
+:- pred describe_several_call_sites(module_info::in, should_module_qualify::in,
assoc_list(pred_proc_id, prog_context)::in,
list(format_component)::out) is det.
@@ -55,17 +62,16 @@
:- import_module parse_tree__prog_out.
:- import_module parse_tree__prog_util.
-:- import_module string, list, term.
+:- import_module int, string, list, term, require.
%-----------------------------------------------------------------------------%
% The code of this predicate duplicates the functionality of
% hlds_out__write_pred_id. Changes here should be made there as well.
-describe_one_pred_name(Module, PredId, Piece) :-
+describe_one_pred_name(Module, ShouldModuleQualify, PredId, Piece) :-
module_info_pred_info(Module, PredId, PredInfo),
ModuleName = pred_info_module(PredInfo),
- prog_out__sym_name_to_string(ModuleName, ModuleNameString),
PredName = pred_info_name(PredInfo),
Arity = pred_info_arity(PredInfo),
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
@@ -81,55 +87,57 @@
string__append_list([
PredOrFuncPart,
" `",
- ModuleNameString,
- ".",
+ module_qualification(ModuleName, ShouldModuleQualify),
PredName,
"/",
ArityPart,
"'"], Piece)
).
-describe_one_pred_name_mode(Module, PredId, InstVarSet, ArgModes, Piece) :-
+describe_one_pred_name_mode(Module, ShouldModuleQualify, PredId, InstVarSet,
+ ArgModes0, Piece) :-
module_info_pred_info(Module, PredId, PredInfo),
ModuleName = pred_info_module(PredInfo),
- prog_out__sym_name_to_string(ModuleName, ModuleNameString),
PredName = pred_info_name(PredInfo),
+ Arity = pred_info_arity(PredInfo),
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
- PredOrFuncPart = pred_or_func_to_string(PredOrFunc),
- strip_builtin_qualifiers_from_mode_list(ArgModes, StrippedArgModes),
+ list__length(ArgModes0, NumArgModes),
+ % We need to strip off the extra type_info arguments inserted at the
+ % front by polymorphism.m - we only want the last `Arity' of them.
+ ( list__drop(NumArgModes - Arity, ArgModes0, ArgModes) ->
+ strip_builtin_qualifiers_from_mode_list(ArgModes,
+ StrippedArgModes)
+ ;
+ error("describe_one_pred_name_mode: bad argument list")
+ ),
(
PredOrFunc = predicate,
ArgModesPart =
- "(" ++
- mercury_mode_list_to_string(StrippedArgModes,
- InstVarSet) ++
- ")"
+ arg_modes_to_string(InstVarSet, StrippedArgModes)
;
PredOrFunc = function,
pred_args_to_func_args(StrippedArgModes, FuncArgModes,
FuncRetMode),
ArgModesPart =
- "(" ++
- mercury_mode_list_to_string(FuncArgModes,
- InstVarSet) ++
- ") = " ++
+ arg_modes_to_string(InstVarSet, FuncArgModes) ++
+ " = " ++
mercury_mode_to_string(FuncRetMode, InstVarSet)
),
string__append_list([
- PredOrFuncPart,
- " `",
- ModuleNameString,
- ".",
+ "`",
+ module_qualification(ModuleName, ShouldModuleQualify),
PredName,
ArgModesPart,
"'"], Piece).
-describe_several_pred_names(Module, PredId, Pieces) :-
- list__map(describe_one_pred_name(Module), PredId, Pieces0),
+describe_several_pred_names(Module, ShouldModuleQualify, PredId, Pieces) :-
+ list__map(describe_one_pred_name(Module, ShouldModuleQualify),
+ PredId, Pieces0),
list_to_pieces(Pieces0, Pieces).
-describe_one_proc_name(Module, proc(PredId, ProcId), Piece) :-
- describe_one_pred_name(Module, PredId, PredPiece),
+describe_one_proc_name(Module, ShouldModuleQualify, proc(PredId, ProcId),
+ Piece) :-
+ describe_one_pred_name(Module, ShouldModuleQualify, PredId, PredPiece),
proc_id_to_int(ProcId, ProcIdInt),
string__int_to_string(ProcIdInt, ProcIdPart),
string__append_list([
@@ -138,12 +146,21 @@
ProcIdPart
], Piece).
-describe_several_proc_names(Module, PPIds, Pieces) :-
- list__map(describe_one_proc_name(Module), PPIds, Pieces0),
+describe_one_proc_name_mode(Module, ShouldModuleQualify, proc(PredId, ProcId),
+ Piece) :-
+ module_info_pred_proc_info(Module, PredId, ProcId, _, ProcInfo),
+ proc_info_argmodes(ProcInfo, ArgModes),
+ proc_info_inst_varset(ProcInfo, InstVarSet),
+ describe_one_pred_name_mode(Module, ShouldModuleQualify, PredId,
+ InstVarSet, ArgModes, Piece).
+
+describe_several_proc_names(Module, ShouldModuleQualify, PPIds, Pieces) :-
+ list__map(describe_one_proc_name(Module, ShouldModuleQualify),
+ PPIds, Pieces0),
list_to_pieces(Pieces0, Pieces).
-describe_one_call_site(Module, PPId - Context, Piece) :-
- describe_one_proc_name(Module, PPId, ProcName),
+describe_one_call_site(Module, ShouldModuleQualify, PPId - Context, Piece) :-
+ describe_one_proc_name(Module, ShouldModuleQualify, PPId, ProcName),
term__context_file(Context, FileName),
term__context_line(Context, LineNumber),
string__int_to_string(LineNumber, LineNumberPart),
@@ -155,6 +172,31 @@
LineNumberPart
], Piece).
-describe_several_call_sites(Module, Sites, Pieces) :-
- list__map(describe_one_call_site(Module), Sites, Pieces0),
+describe_several_call_sites(Module, ShouldModuleQualify, Sites, Pieces) :-
+ list__map(describe_one_call_site(Module, ShouldModuleQualify),
+ Sites, Pieces0),
list_to_pieces(Pieces0, Pieces).
+
+:- func module_qualification(module_name, should_module_qualify) = string.
+
+module_qualification(ModuleName, ShouldModuleQualify) = ModuleQualification :-
+ (
+ ShouldModuleQualify = should_module_qualify,
+ prog_out__sym_name_to_string(ModuleName, ModuleNameString),
+ ModuleQualification = string__append(ModuleNameString, ".")
+ ;
+ ShouldModuleQualify = should_not_module_qualify,
+ ModuleQualification = ""
+ ).
+
+:- func arg_modes_to_string(inst_varset, list(mode)) = string.
+
+arg_modes_to_string(InstVarSet, ArgModes) = Str :-
+ (
+ ArgModes = [],
+ Str = ""
+ ;
+ ArgModes = [_ | _],
+ ArgsStr = mercury_mode_list_to_string(ArgModes, InstVarSet),
+ Str = "(" ++ ArgsStr ++ ")"
+ ).
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.328
diff -u -r1.328 hlds_out.m
--- compiler/hlds_out.m 10 Apr 2004 10:33:01 -0000 1.328
+++ compiler/hlds_out.m 14 May 2004 08:30:27 -0000
@@ -33,10 +33,12 @@
:- interface.
% Parse tree modules
+:- import_module parse_tree__error_util.
:- import_module parse_tree__inst.
:- import_module parse_tree__prog_data.
% HLDS modules
:- import_module hlds__hlds_data.
+% :- import_module hlds__hlds_error_util.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
@@ -47,6 +49,7 @@
%-----------------------------------------------------------------------------%
:- pred hlds_out__write_type_ctor(type_ctor::in, io::di, io::uo) is det.
+:- func hlds_out__type_ctor_to_string(type_ctor) = string.
:- pred hlds_out__write_class_id(class_id::in, io::di, io::uo) is det.
@@ -71,6 +74,7 @@
io::di, io::uo) is det.
:- pred hlds_out__write_call_id(call_id::in, io::di, io::uo) is det.
+:- func hlds_out__call_id_to_string(call_id) = string.
:- pred hlds_out__write_simple_call_id(simple_call_id::in, io::di, io::uo)
is det.
@@ -93,6 +97,7 @@
% any explicit call.
:- pred hlds_out__write_call_arg_id(call_id::in, int::in, pred_markers::in,
io::di, io::uo) is det.
+:- func hlds_out__call_arg_id_to_string(call_id, int, pred_markers) = string.
% Print "predicate" or "function" depending on the given value.
:- pred hlds_out__write_pred_or_func(pred_or_func::in, io::di, io::uo) is det.
@@ -125,6 +130,9 @@
:- pred hlds_out__write_unify_context(bool::in, unify_context::in,
prog_context::in, bool::out, io::di, io::uo) is det.
+:- pred hlds_out__unify_context_to_pieces(unify_context::in,
+ list(format_component)::in, list(format_component)::out) is det.
+
:- pred hlds_out__write_determinism(determinism::in, io::di, io::uo) is det.
:- func hlds_out__determinism_to_string(determinism) = string.
@@ -271,6 +279,9 @@
hlds_out__write_type_ctor(Name - Arity, !IO) :-
prog_out__write_sym_name_and_arity(Name / Arity, !IO).
+hlds_out__type_ctor_to_string(Name - Arity) = Str :-
+ prog_out__sym_name_and_arity_to_string(Name / Arity, Str).
+
hlds_out__write_class_id(class_id(Name, Arity), !IO) :-
prog_out__write_sym_name_and_arity(Name / Arity, !IO).
@@ -341,7 +352,7 @@
io__write_string("<table_io_decl>").
% The code of this predicate duplicates the functionality of
- % error_util__describe_one_pred_name. Changes here should be made
+ % hlds_error_util__describe_one_pred_name. Changes here should be made
% there as well.
hlds_out__write_pred_id(ModuleInfo, PredId, !IO) :-
@@ -445,32 +456,44 @@
SymName/OrigArity) :-
adjust_func_arity(PredOrFunc, OrigArity, Arity).
-hlds_out__write_call_id(call(PredCallId), !IO) :-
- hlds_out__write_simple_call_id(PredCallId, !IO).
-hlds_out__write_call_id(generic_call(GenericCallId), !IO) :-
- hlds_out__write_generic_call_id(GenericCallId, !IO).
+hlds_out__write_call_id(CallId, !IO) :-
+ Str = hlds_out__call_id_to_string(CallId),
+ io__write_string(Str, !IO).
+
+hlds_out__call_id_to_string(call(PredCallId)) =
+ hlds_out__simple_call_id_to_string(PredCallId).
+hlds_out__call_id_to_string(generic_call(GenericCallId)) =
+ hlds_out__generic_call_id_to_string(GenericCallId).
:- pred hlds_out__write_generic_call_id(generic_call_id::in,
io::di, io::uo) is det.
-hlds_out__write_generic_call_id(higher_order(Purity, PredOrFunc, _), !IO) :-
- write_purity_prefix(Purity, !IO),
- io__write_string("higher-order ", !IO),
- hlds_out__write_pred_or_func(PredOrFunc, !IO),
- io__write_string(" call", !IO).
-
-hlds_out__write_generic_call_id(class_method(_ClassId, MethodId), !IO) :-
- hlds_out__write_simple_call_id(MethodId, !IO).
+hlds_out__write_generic_call_id(GenericCallId, !IO) :-
+ Str = hlds_out__generic_call_id_to_string(GenericCallId),
+ io__write_string(Str, !IO).
-hlds_out__write_generic_call_id(unsafe_cast, !IO) :-
- io__write_string("unsafe_cast", !IO).
+:- func hlds_out__generic_call_id_to_string(generic_call_id) = string.
-hlds_out__write_generic_call_id(aditi_builtin(AditiBuiltin, CallId), !IO) :-
+hlds_out__generic_call_id_to_string(higher_order(Purity, PredOrFunc, _)) =
+ purity_prefix_to_string(Purity)
+ ++ "higher-order "
+ ++ pred_or_func_to_full_str(PredOrFunc)
+ ++ " call".
+hlds_out__generic_call_id_to_string(class_method(_ClassId, MethodId)) =
+ hlds_out__simple_call_id_to_string(MethodId).
+hlds_out__generic_call_id_to_string(unsafe_cast) =
+ "unsafe_cast".
+hlds_out__generic_call_id_to_string(aditi_builtin(AditiBuiltin, CallId))
+ = Str :-
hlds_out__aditi_builtin_name(AditiBuiltin, Name),
- io__write_strings(["`", Name, "' of "], !IO),
- hlds_out__write_simple_call_id(CallId, !IO).
+ Str = "`" ++ Name ++ "' of " ++
+ hlds_out__simple_call_id_to_string(CallId).
hlds_out__write_call_arg_id(CallId, ArgNum, PredMarkers, !IO) :-
+ Str = hlds_out__call_arg_id_to_string(CallId, ArgNum, PredMarkers),
+ io__write_string(Str, !IO).
+
+hlds_out__call_arg_id_to_string(CallId, ArgNum, PredMarkers) = Str :-
( ArgNum =< 0 ->
% Argument numbers that are less than or equal to zero
% are used for the type_info and typeclass_info arguments
@@ -480,10 +503,10 @@
% about which argument it is.
% For both of these, we just say "in call to"
% rather than "in argument N of call to".
- true
+ Str1 = ""
;
- hlds_out__write_arg_number(CallId, ArgNum, !IO),
- io__write_string(" of ", !IO)
+ Str1 = hlds_out__arg_number_to_string(CallId, ArgNum)
+ ++ " of "
),
(
(
@@ -502,94 +525,90 @@
check_marker(PredMarkers, named_class_instance_method)
)
->
- true
+ Str2 = Str1
;
- io__write_string("call to ", !IO)
+ Str2 = Str1 ++ "call to "
),
- hlds_out__write_call_id(CallId, !IO).
+ Str = Str2 ++ call_id_to_string(CallId).
:- pred hlds_out__write_arg_number(call_id::in, int::in, io::di, io::uo)
is det.
-hlds_out__write_arg_number(call(PredOrFunc - _/Arity), ArgNum, !IO) :-
+hlds_out__write_arg_number(CallId, ArgNum, !IO) :-
+ Str = hlds_out__arg_number_to_string(CallId, ArgNum),
+ io__write_string(Str, !IO).
+
+:- func hlds_out__arg_number_to_string(call_id, int) = string.
+
+hlds_out__arg_number_to_string(call(PredOrFunc - _/Arity), ArgNum) =
(
PredOrFunc = function,
Arity = ArgNum
->
- io__write_string("the return value", !IO)
+ "the return value"
;
- io__write_string("argument ", !IO),
- io__write_int(ArgNum, !IO)
+ "argument " ++ int_to_string(ArgNum)
).
-hlds_out__write_arg_number(generic_call(
- higher_order(_Purity, PredOrFunc, Arity)), ArgNum, !IO) :-
+hlds_out__arg_number_to_string(generic_call(
+ higher_order(_Purity, PredOrFunc, Arity)), ArgNum) = Str :-
(
PredOrFunc = function,
ArgNum = Arity
->
- io__write_string("the return value", !IO)
+ Str = "the return value"
;
- io__write_string("argument ", !IO),
- io__write_int(ArgNum, !IO),
-
% Make error messages for higher-order calls
% such as `P(A, B)' clearer.
- io__write_string(" (i.e. ", !IO),
+ Main = "argument " ++ int_to_string(ArgNum),
+ PredOrFuncStr = pred_or_func_to_full_str(PredOrFunc),
( ArgNum = 1 ->
- io__write_string("the ", !IO),
- hlds_out__write_pred_or_func(PredOrFunc, !IO),
- io__write_string(" term", !IO)
+ Expl = "the " ++ PredOrFuncStr ++ " term"
;
- io__write_string("argument ", !IO),
- io__write_int(ArgNum - 1, !IO),
- io__write_string(" of the called ", !IO),
- hlds_out__write_pred_or_func(PredOrFunc, !IO)
- )
+ Expl = "argument " ++ int_to_string(ArgNum - 1)
+ ++ " of the called " ++ PredOrFuncStr
),
- io__write_string(")", !IO).
-
-hlds_out__write_arg_number(generic_call(class_method(_, _)), ArgNum, !IO) :-
- io__write_string("argument ", !IO),
- io__write_int(ArgNum, !IO).
-
-hlds_out__write_arg_number(generic_call(unsafe_cast), ArgNum, !IO) :-
- io__write_string("argument ", !IO),
- io__write_int(ArgNum, !IO).
-
-hlds_out__write_arg_number(generic_call(aditi_builtin(Builtin, CallId)),
- ArgNum, !IO) :-
- hlds_out__write_aditi_builtin_arg_number(Builtin, CallId, ArgNum, !IO).
+ Str = Main ++ " (i.e. " ++ Expl ++ ")"
+ ).
+hlds_out__arg_number_to_string(generic_call(class_method(_, _)), ArgNum) =
+ "argument " ++ int_to_string(ArgNum).
+hlds_out__arg_number_to_string(generic_call(unsafe_cast), ArgNum) =
+ "argument " ++ int_to_string(ArgNum).
+hlds_out__arg_number_to_string(generic_call(aditi_builtin(Builtin, CallId)),
+ ArgNum) =
+ hlds_out__aditi_builtin_arg_number_to_string(Builtin, CallId, ArgNum).
:- pred hlds_out__write_aditi_builtin_arg_number(aditi_builtin::in,
simple_call_id::in, int::in, io::di, io::uo) is det.
-hlds_out__write_aditi_builtin_arg_number(aditi_tuple_update(InsertDelete, _),
- _ - _/Arity, ArgNum, !IO) :-
- io__write_string("argument ", !IO),
+hlds_out__write_aditi_builtin_arg_number(Builtin, SimpleCallId, ArgNum, !IO) :-
+ Str = hlds_out__aditi_builtin_arg_number_to_string(Builtin,
+ SimpleCallId, ArgNum),
+ io__write_string(Str, !IO).
+
+:- func hlds_out__aditi_builtin_arg_number_to_string(aditi_builtin,
+ simple_call_id, int) = string.
+
+hlds_out__aditi_builtin_arg_number_to_string(
+ aditi_tuple_update(InsertDelete, _),
+ _ - _/Arity, ArgNum) = Str :-
( ArgNum =< Arity ->
- io__write_int(ArgNum, !IO),
- io__write_string(" of the ", !IO),
- ( InsertDelete = insert, Str = "inserted"
- ; InsertDelete = delete, Str = "deleted"
+ ( InsertDelete = insert, OpStr = "inserted"
+ ; InsertDelete = delete, OpStr = "deleted"
),
- io__write_string(Str, !IO),
- io__write_string(" tuple", !IO)
+ Str = "argument " ++ int_to_string(ArgNum) ++
+ " of the " ++ OpStr ++ " tuple"
;
- io__write_int(ArgNum - Arity + 1, !IO)
+ Str = "argument " ++ int_to_string(ArgNum - Arity + 1)
).
-
-hlds_out__write_aditi_builtin_arg_number(aditi_bulk_update(_, _, pred_term),
- _, ArgNum, !IO) :-
- io__write_string("argument ", !IO),
- io__write_int(ArgNum, !IO).
-
-hlds_out__write_aditi_builtin_arg_number(
+hlds_out__aditi_builtin_arg_number_to_string(aditi_bulk_update(_, _, pred_term),
+ _, ArgNum) = Str :-
+ Str = "argument " ++ int_to_string(ArgNum).
+hlds_out__aditi_builtin_arg_number_to_string(
aditi_bulk_update(_, _, sym_name_and_closure),
- _, ArgNum, !IO) :-
+ _, ArgNum) = Str :-
% The original goal had a sym_name/arity
% at the front of the argument list.
- io__write_string("argument ", !IO),
- io__write_int(ArgNum + 1, !IO).
+ Str = "argument " ++ int_to_string(ArgNum + 1).
hlds_out__write_pred_or_func(predicate, !IO) :-
io__write_string("predicate", !IO).
@@ -608,15 +627,20 @@
hlds_out__write_unify_context(UnifyContext, Context, !IO) :-
hlds_out__write_unify_context(no, UnifyContext, Context, _, !IO).
-hlds_out__write_unify_context(First0,
- unify_context(MainContext, RevSubContexts), Context, First,
- !IO) :-
+hlds_out__write_unify_context(First0, UnifyContext, Context, First, !IO) :-
+ UnifyContext = unify_context(MainContext, RevSubContexts),
+ list__reverse(RevSubContexts, SubContexts),
hlds_out__write_unify_main_context(First0, MainContext, Context,
First1, !IO),
- list__reverse(RevSubContexts, SubContexts),
hlds_out__write_unify_sub_contexts(First1, SubContexts, Context,
First, !IO).
+hlds_out__unify_context_to_pieces(UnifyContext, !Pieces) :-
+ UnifyContext = unify_context(MainContext, RevSubContexts),
+ list__reverse(RevSubContexts, SubContexts),
+ hlds_out__unify_main_context_to_pieces(MainContext, !Pieces),
+ hlds_out__unify_sub_contexts_to_pieces(SubContexts, !Pieces).
+
:- pred hlds_out__write_unify_main_context(bool::in, unify_main_context::in,
prog_context::in, bool::out, io::di, io::uo) is det.
@@ -648,6 +672,34 @@
hlds_out__start_in_message(First, Context, !IO),
io__format("implicit %s unification:\n", [s(Source)], !IO).
+:- pred hlds_out__unify_main_context_to_pieces(unify_main_context::in,
+ list(format_component)::in, list(format_component)::out) is det.
+
+hlds_out__unify_main_context_to_pieces(explicit, !Pieces).
+hlds_out__unify_main_context_to_pieces(head(ArgNum), !Pieces) :-
+ hlds_out__in_argument_to_pieces(ArgNum, !Pieces),
+ !:Pieces = !.Pieces ++ [words("of clause head:"), nl].
+hlds_out__unify_main_context_to_pieces(head_result, !Pieces) :-
+ hlds_out__start_in_message_to_pieces(!Pieces),
+ !:Pieces = !.Pieces ++
+ [words("function result term of clause head:"), nl].
+hlds_out__unify_main_context_to_pieces(call(CallId, ArgNum), !Pieces) :-
+ hlds_out__start_in_message_to_pieces(!Pieces),
+ % The markers argument below is used only for type class method
+ % implementations defined using the named syntax rather than
+ % the clause syntax, and the bodies of such procedures should
+ % only contain a single call, so we shouldn't get unifications
+ % nested inside calls. Hence we can safely initialize the
+ % markers to empty here. (Anyway the worst possible consequence
+ % is slightly sub-optimal text for an error message.)
+ init_markers(Markers),
+ ArgIdStr = hlds_out__call_arg_id_to_string(CallId, ArgNum, Markers),
+ !:Pieces = !.Pieces ++ [words(ArgIdStr ++ ":"), nl].
+hlds_out__unify_main_context_to_pieces(implicit(Source), !Pieces) :-
+ hlds_out__start_in_message_to_pieces(!Pieces),
+ string__format("implicit %s unification:\n", [s(Source)], Msg),
+ !:Pieces = !.Pieces ++ [words(Msg)].
+
:- pred hlds_out__write_unify_sub_contexts(bool::in, unify_sub_contexts::in,
prog_context::in, bool::out, io::di, io::uo) is det.
@@ -661,6 +713,19 @@
hlds_out__write_unify_sub_contexts(no, SubContexts, Context, First,
!IO).
+:- pred hlds_out__unify_sub_contexts_to_pieces(unify_sub_contexts::in,
+ list(format_component)::in, list(format_component)::out) is det.
+
+hlds_out__unify_sub_contexts_to_pieces([], !Pieces).
+hlds_out__unify_sub_contexts_to_pieces([ConsId - ArgNum | SubContexts],
+ !Pieces) :-
+ hlds_out__in_argument_to_pieces(ArgNum, !Pieces),
+ NewPieces = [words("of functor"),
+ fixed("`" ++ cons_id_to_string(ConsId) ++ "':"),
+ nl],
+ !:Pieces = !.Pieces ++ NewPieces,
+ hlds_out__unify_sub_contexts_to_pieces(SubContexts, !Pieces).
+
:- pred hlds_out__write_in_argument(bool::in, int::in, prog_context::in,
io::di, io::uo) is det.
@@ -669,6 +734,14 @@
io__write_string("argument ", !IO),
io__write_int(ArgNum, !IO).
+:- pred hlds_out__in_argument_to_pieces(int::in,
+ list(format_component)::in, list(format_component)::out) is det.
+
+hlds_out__in_argument_to_pieces(ArgNum, !Pieces) :-
+ hlds_out__start_in_message_to_pieces(!Pieces),
+ ArgNumStr = int_to_string(ArgNum),
+ !:Pieces = !.Pieces ++ [words("argument"), words(ArgNumStr)].
+
:- pred hlds_out__start_in_message(bool::in, prog_context::in,
io::di, io::uo) is det.
@@ -678,6 +751,18 @@
io__write_string(" In ", !IO)
;
io__write_string(" in ", !IO)
+ ).
+
+:- pred hlds_out__start_in_message_to_pieces(
+ list(format_component)::in, list(format_component)::out) is det.
+
+hlds_out__start_in_message_to_pieces(!Pieces) :-
+ (
+ !.Pieces = [],
+ !:Pieces = !.Pieces ++ [words("In")]
+ ;
+ !.Pieces = [_ | _],
+ !:Pieces = !.Pieces ++ [words("in")]
).
%-----------------------------------------------------------------------------%
Index: compiler/magic_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic_util.m,v
retrieving revision 1.37
diff -u -r1.37 magic_util.m
--- compiler/magic_util.m 19 Mar 2004 10:19:20 -0000 1.37
+++ compiler/magic_util.m 14 May 2004 08:30:27 -0000
@@ -1758,7 +1758,8 @@
magic_util__report_error(ModuleInfo, Verbose,
argument_error(Error, Arg, proc(PredId, _)) - Context) -->
- { describe_one_pred_name(ModuleInfo, PredId, PredName) },
+ { describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredName) },
{ string__append_list(["In Aditi ", PredName, ":"], PredNamePiece) },
{ magic_util__error_arg_id_piece(Arg, ArgPiece) },
{ magic_util__report_argument_error(Context, Error, ArgPiece,
@@ -1767,7 +1768,8 @@
magic_util__report_error(ModuleInfo, _Verbose,
nonspecific_polymorphism(proc(PredId, _), _) - Context) -->
- { describe_one_pred_name(ModuleInfo, PredId, PredName) },
+ { describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredName) },
{ string__append_list(["In ", PredName, ":"], PredNamePiece) },
{ SecondPart = [words("the code uses polymorphism or type-classes"),
words("which are not supported by Aditi.")] },
@@ -1775,7 +1777,8 @@
magic_util__report_error(ModuleInfo, _Verbose,
curried_argument(proc(PredId, _)) - Context) -->
- { describe_one_pred_name(ModuleInfo, PredId, PredName) },
+ { describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredName) },
{ string__append_list(["In ", PredName, ":"], PredNamePiece) },
{ SecondPart = [words("sorry, curried closure arguments are not"),
words("implemented for Aditi procedures."),
@@ -1785,7 +1788,8 @@
magic_util__report_error(ModuleInfo, _Verbose,
non_removeable_aditi_state(proc(PredId, _), VarSet, Vars)
- Context) -->
- { describe_one_pred_name(ModuleInfo, PredId, PredName) },
+ { describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredName) },
{ string__append_list(["In ", PredName, ":"], PredNamePiece) },
{ Vars = [_] ->
VarPiece = words("variable"),
@@ -1802,7 +1806,8 @@
magic_util__report_error(ModuleInfo, Verbose,
context_error(Error, proc(PredId, _ProcId)) - Context) -->
- { describe_one_pred_name(ModuleInfo, PredId, PredName) },
+ { describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId, PredName) },
{ string__append_list(["In ", PredName, ":"], PredNamePiece) },
{ SecondPart = [words("with `:- pragma context(...)' declaration:"),
nl, words("error: recursive rule is not linear.\n")] },
@@ -1815,9 +1820,9 @@
magic_util__report_error(ModuleInfo, _Verbose,
mutually_recursive_context(PredProcId,
OtherPredProcIds) - Context) -->
- { describe_one_proc_name(ModuleInfo,
+ { describe_one_proc_name(ModuleInfo, should_module_qualify,
PredProcId, ProcPiece) },
- { describe_several_proc_names(ModuleInfo,
+ { describe_several_proc_names(ModuleInfo, should_module_qualify,
OtherPredProcIds, OtherProcPieces) },
{ list__condense(
[[words("Error: procedure"), words(ProcPiece), words("with a"),
@@ -1828,7 +1833,7 @@
magic_util__report_error(ModuleInfo, _Verbose,
mixed_scc(PredProcIds) - Context) -->
- { describe_several_proc_names(ModuleInfo,
+ { describe_several_proc_names(ModuleInfo, should_module_qualify,
PredProcIds, SCCPieces) },
{ list__condense([
[words("In the strongly connected component consisting of")],
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.305
diff -u -r1.305 mercury_compile.m
--- compiler/mercury_compile.m 23 Mar 2004 10:52:06 -0000 1.305
+++ compiler/mercury_compile.m 14 May 2004 08:30:28 -0000
@@ -2552,8 +2552,8 @@
PredId, PredInfo, !HLDS, !GlobalData,
Code1, !IO),
module_info_globals(!.HLDS, Globals2),
- globals__set_trace_level(Globals2, TraceLevel,
- Globals),
+ globals__set_trace_level(TraceLevel,
+ Globals2, Globals),
module_info_set_globals(Globals, !HLDS),
copy(Globals, GlobalsUnique),
globals__io_set_globals(GlobalsUnique, !IO)
Index: compiler/passes_aux.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/passes_aux.m,v
retrieving revision 1.60
diff -u -r1.60 passes_aux.m
--- compiler/passes_aux.m 5 Apr 2004 05:07:42 -0000 1.60
+++ compiler/passes_aux.m 14 May 2004 08:30:28 -0000
@@ -141,9 +141,18 @@
:- pred maybe_report_sizes(module_info::in, io::di, io::uo) is det.
+ % Prints the id of the given procedure via report_pred_name_mode,
+ % preceded by "In: " and the context.
+ % In new code, use describe_one_pred_name_mode in error_util instead.
:- pred report_pred_proc_id(module_info::in, pred_id::in, proc_id::in,
maybe(prog_context)::in, prog_context::out, io::di, io::uo) is det.
+ % report_pred_name_mode(PredOrFunc, Name, ArgModes):
+ % Depending on PredOrFunc, prints either
+ % Name(ArgMode1, ..., ArgModeN)
+ % or
+ % Name(ArgMode1, ..., ArgModeN-1) = ArgModeN
+ % In new code, use describe_one_pred_name_mode in error_util instead.
:- pred report_pred_name_mode(pred_or_func::in, string::in, list(mode)::in,
io::di, io::uo) is det.
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.38
diff -u -r1.38 rl_exprn.m
--- compiler/rl_exprn.m 23 Mar 2004 10:52:11 -0000 1.38
+++ compiler/rl_exprn.m 14 May 2004 08:30:28 -0000
@@ -986,7 +986,8 @@
rl_exprn__call_not_implemented_error(Context,
ModuleInfo, PredId, ProcId, ErrorDescr) :-
- describe_one_proc_name(ModuleInfo, proc(PredId, ProcId), ProcName),
+ describe_one_proc_name(ModuleInfo, should_module_qualify,
+ proc(PredId, ProcId), ProcName),
prog_out__context_to_string(Context, ContextStr),
string__append_list(
[
Index: compiler/source_file_map.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/source_file_map.m,v
retrieving revision 1.7
diff -u -r1.7 source_file_map.m
--- compiler/source_file_map.m 21 Jul 2003 14:08:40 -0000 1.7
+++ compiler/source_file_map.m 14 May 2004 08:30:28 -0000
@@ -91,8 +91,8 @@
{ SourceFileMap = map__init }
),
globals__io_get_globals(Globals1),
- { globals__set_source_file_map(Globals1,
- yes(SourceFileMap), Globals2) },
+ { globals__set_source_file_map(yes(SourceFileMap),
+ Globals1, Globals2) },
{ unsafe_promise_unique(Globals2, Globals) },
globals__io_set_globals(Globals)
).
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.59
diff -u -r1.59 table_gen.m
--- compiler/table_gen.m 5 Apr 2004 05:07:43 -0000 1.59
+++ compiler/table_gen.m 14 May 2004 08:30:29 -0000
@@ -489,7 +489,8 @@
report_missing_tabled_for_io(ModuleInfo, PredInfo, PredId, ProcId) -->
{ pred_info_context(PredInfo, Context) },
- { describe_one_proc_name(ModuleInfo, proc(PredId, ProcId), Name) },
+ { describe_one_proc_name(ModuleInfo, should_not_module_qualify,
+ proc(PredId, ProcId), Name) },
{ Msg = [fixed(Name), words("contains untabled I/O primitive.")] },
error_util__write_error_pieces(Context, 0, Msg).
Index: compiler/term_errors.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/term_errors.m,v
retrieving revision 1.24
diff -u -r1.24 term_errors.m
--- compiler/term_errors.m 5 Apr 2004 05:07:43 -0000 1.24
+++ compiler/term_errors.m 14 May 2004 08:30:29 -0000
@@ -162,13 +162,15 @@
get_context_from_scc(SCC, Module, Context),
( SCC = [PPId] ->
Pieces0 = [words("Termination of")],
- describe_one_proc_name(Module, PPId, PredName),
+ describe_one_proc_name(Module, should_module_qualify, PPId,
+ PredName),
list__append(Pieces0, [fixed(PredName)], Pieces1),
Single = yes(PPId)
;
Pieces0 = [words("Termination of the "),
words("mutually recursive procedures")],
- describe_several_proc_names(Module, SCC, ProcNamePieces),
+ describe_several_proc_names(Module, should_module_qualify, SCC,
+ ProcNamePieces),
list__append(Pieces0, ProcNamePieces, Pieces1),
Single = no
),
@@ -202,13 +204,15 @@
get_context_from_scc(SCC, Module, Context),
( SCC = [PPId] ->
Pieces0 = [words("Termination constant of")],
- describe_one_proc_name(Module, PPId, ProcName),
+ describe_one_proc_name(Module, should_module_qualify, PPId,
+ ProcName),
list__append(Pieces0, [fixed(ProcName)], Pieces1),
Single = yes(PPId)
;
Pieces0 = [words("Termination constants"),
words("of the mutually recursive procedures")],
- describe_several_proc_names(Module, SCC, ProcNamePieces),
+ describe_several_proc_names(Module, should_module_qualify, SCC,
+ ProcNamePieces),
list__append(Pieces0, ProcNamePieces, Pieces1),
Single = no
),
@@ -295,11 +299,13 @@
Piece1 = words("It")
;
Single = no,
- describe_one_proc_name(Module, CallerPPId, ProcName),
+ describe_one_proc_name(Module, should_module_qualify,
+ CallerPPId, ProcName),
Piece1 = fixed(ProcName)
),
Piece2 = words("calls"),
- describe_one_proc_name(Module, CalleePPId, CalleePiece),
+ describe_one_proc_name(Module, should_module_qualify, CalleePPId,
+ CalleePiece),
Pieces3 = [words("with an unbounded increase"),
words("in the size of the input arguments.")],
Pieces = [Piece1, Piece2, fixed(CalleePiece) | Pieces3].
@@ -312,11 +318,13 @@
Piece1 = words("It")
;
Single = no,
- describe_one_proc_name(Module, CallerPPId, ProcName),
+ describe_one_proc_name(Module, should_module_qualify,
+ CallerPPId, ProcName),
Piece1 = fixed(ProcName)
),
Piece2 = words("calls"),
- describe_one_proc_name(Module, CalleePPId, CalleePiece),
+ describe_one_proc_name(Module, should_module_qualify,
+ CalleePPId, CalleePiece),
Pieces3 = [words("which could not be proven to terminate.")],
Pieces = [Piece1, Piece2, fixed(CalleePiece) | Pieces3].
@@ -333,11 +341,13 @@
Piece1 = words("It")
;
Single = no,
- describe_one_proc_name(Module, CallerPPId, ProcName),
+ describe_one_proc_name(Module, should_module_qualify,
+ CallerPPId, ProcName),
Piece1 = fixed(ProcName)
),
Piece2 = words("calls"),
- describe_one_proc_name(Module, CalleePPId, CalleePiece),
+ describe_one_proc_name(Module, should_module_qualify,
+ CalleePPId, CalleePiece),
Pieces3 = [words("with one or more higher order arguments.")],
Pieces = [Piece1, Piece2, fixed(CalleePiece) | Pieces3].
@@ -349,11 +359,13 @@
Piece1 = words("It")
;
Single = no,
- describe_one_proc_name(Module, CallerPPId, ProcName),
+ describe_one_proc_name(Module, should_module_qualify,
+ CallerPPId, ProcName),
Piece1 = fixed(ProcName)
),
Piece2 = words("calls"),
- describe_one_proc_name(Module, CalleePPId, CalleePiece),
+ describe_one_proc_name(Module, should_module_qualify,
+ CalleePPId, CalleePiece),
Pieces3 = [words("which has a termination constant of infinity.")],
Pieces = [Piece1, Piece2, fixed(CalleePiece) | Pieces3].
@@ -367,14 +379,16 @@
;
% XXX this should never happen (but it does)
% error("not_subset outside this SCC"),
- describe_one_proc_name(Module, ProcPPId, PPIdPiece),
+ describe_one_proc_name(Module, should_module_qualify,
+ ProcPPId, PPIdPiece),
Pieces1 = [words("The set of"),
words("output supplier variables of"),
fixed(PPIdPiece)]
)
;
Single = no,
- describe_one_proc_name(Module, ProcPPId, PPIdPiece),
+ describe_one_proc_name(Module, should_module_qualify,
+ ProcPPId, PPIdPiece),
Pieces1 = [words("The set of output supplier variables of"),
fixed(PPIdPiece)]
),
@@ -394,7 +408,8 @@
term_errors__description(cycle(_StartPPId, CallSites), _, Module, Pieces, no) :-
( CallSites = [DirectCall] ->
- describe_one_call_site(Module, DirectCall, Site),
+ describe_one_call_site(Module, should_module_qualify,
+ DirectCall, Site),
Pieces = [words("At the recursive call to"),
fixed(Site),
words("the arguments are"),
@@ -402,7 +417,8 @@
;
Pieces1 = [words("In the recursive cycle"),
words("through the calls to")],
- describe_several_call_sites(Module, CallSites, SitePieces),
+ describe_several_call_sites(Module, should_module_qualify,
+ CallSites, SitePieces),
Pieces2 = [words("the arguments are"),
words("not guaranteed to decrease in size.")],
list__condense([Pieces1, SitePieces, Pieces2], Pieces)
@@ -436,7 +452,8 @@
Piece2 = words("it.")
;
Single = no,
- describe_one_pred_name(Module, PredId, Piece2Nodot),
+ describe_one_pred_name(Module, should_module_qualify,
+ PredId, Piece2Nodot),
string__append(Piece2Nodot, ".", Piece2Str),
Piece2 = fixed(Piece2Str)
),
Index: compiler/termination.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.40
diff -u -r1.40 termination.m
--- compiler/termination.m 23 Mar 2004 10:52:13 -0000 1.40
+++ compiler/termination.m 14 May 2004 08:30:29 -0000
@@ -190,8 +190,8 @@
proc_info_set_maybe_termination_info(
yes(can_loop([TermErr])), ProcInfo0,
ProcInfo),
- describe_one_proc_name(!.Module, PPId,
- ProcName),
+ describe_one_proc_name(!.Module,
+ should_module_qualify, PPId, ProcName),
Piece1 = words("has a `pragma terminates'"),
Piece2 = words("declaration but also has the"),
Piece3 = words("`does_not_terminate' foreign"),
@@ -215,7 +215,8 @@
proc_info_set_maybe_termination_info(
yes(can_loop(TermErrs)),
ProcInfo0, ProcInfo),
- describe_one_proc_name(!.Module, PPId, ProcName),
+ describe_one_proc_name(!.Module,
+ should_module_qualify, PPId, ProcName),
Piece1 = words("has a `pragma does_not_terminate'"),
Piece2 = words("declaration but also has the"),
Piece3 = words("`terminates' foreign code"),
@@ -300,8 +301,8 @@
PredIds = list__map((func(proc(PredId, _)) = PredId),
SCCTerminationKnown),
- describe_several_pred_names(!.Module, PredIds,
- PredNames),
+ describe_several_pred_names(!.Module,
+ should_module_qualify, PredIds, PredNames),
Piece1 = words(
"are mutually recursive but some of their"),
Piece2 = words(
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.351
diff -u -r1.351 typecheck.m
--- compiler/typecheck.m 20 Mar 2004 11:59:43 -0000 1.351
+++ compiler/typecheck.m 14 May 2004 08:30:31 -0000
@@ -362,7 +362,8 @@
;
true
),
- describe_one_pred_name(!.ModuleInfo, PredId, PredName),
+ describe_one_pred_name(!.ModuleInfo, should_module_qualify,
+ PredId, PredName),
generate_stub_clause(PredName, !PredInfo, !.ModuleInfo,
StubClause, VarSet0, VarSet),
Clauses1 = [StubClause],
@@ -4608,7 +4609,8 @@
report_no_clauses(MessageKind, PredId, PredInfo, ModuleInfo, !IO) :-
pred_info_context(PredInfo, Context),
- describe_one_pred_name(ModuleInfo, PredId, PredName0),
+ describe_one_pred_name(ModuleInfo, should_not_module_qualify, PredId,
+ PredName0),
string__append(PredName0, ".", PredName),
ErrorMsg = [ words(MessageKind ++ ": no clauses for "),
fixed(PredName) ],
@@ -6026,7 +6028,8 @@
make_pred_id_preamble(Info, Preamble) :-
typecheck_info_get_module_info(Info, Module),
typecheck_info_get_predid(Info, PredID),
- describe_one_pred_name(Module, PredID, PredName),
+ describe_one_pred_name(Module, should_not_module_qualify, PredID,
+ PredName),
Preamble = "In clause for " ++ PredName ++ ":".
%-----------------------------------------------------------------------------%
cvs server: Diffing compiler/notes
cvs server: Diffing debian
cvs server: Diffing deep_profiler
cvs server: Diffing deep_profiler/notes
cvs server: Diffing doc
cvs server: Diffing extras
cvs server: Diffing extras/aditi
cvs server: Diffing extras/cgi
cvs server: Diffing extras/complex_numbers
cvs server: Diffing extras/complex_numbers/samples
cvs server: Diffing extras/complex_numbers/tests
cvs server: Diffing extras/concurrency
cvs server: Diffing extras/curs
cvs server: Diffing extras/curs/samples
cvs server: Diffing extras/curses
cvs server: Diffing extras/curses/sample
cvs server: Diffing extras/dynamic_linking
cvs server: Diffing extras/error
cvs server: Diffing extras/graphics
cvs server: Diffing extras/graphics/mercury_opengl
cvs server: Diffing extras/graphics/mercury_tcltk
cvs server: Diffing extras/graphics/samples
cvs server: Diffing extras/graphics/samples/calc
cvs server: Diffing extras/graphics/samples/maze
cvs server: Diffing extras/graphics/samples/pent
cvs server: Diffing extras/lazy_evaluation
cvs server: Diffing extras/lex
cvs server: Diffing extras/lex/samples
cvs server: Diffing extras/lex/tests
cvs server: Diffing extras/logged_output
cvs server: Diffing extras/moose
cvs server: Diffing extras/moose/samples
cvs server: Diffing extras/moose/tests
cvs server: Diffing extras/morphine
cvs server: Diffing extras/morphine/non-regression-tests
cvs server: Diffing extras/morphine/scripts
cvs server: Diffing extras/morphine/source
cvs server: Diffing extras/odbc
cvs server: Diffing extras/posix
cvs server: Diffing extras/quickcheck
cvs server: Diffing extras/quickcheck/tutes
cvs server: Diffing extras/references
cvs server: Diffing extras/references/samples
cvs server: Diffing extras/references/tests
cvs server: Diffing extras/stream
cvs server: Diffing extras/trailed_update
cvs server: Diffing extras/trailed_update/samples
cvs server: Diffing extras/trailed_update/tests
cvs server: Diffing extras/xml
cvs server: Diffing extras/xml/samples
cvs server: Diffing java
cvs server: Diffing java/runtime
cvs server: Diffing library
cvs server: Diffing profiler
cvs server: Diffing robdd
cvs server: Diffing runtime
cvs server: Diffing runtime/GETOPT
cvs server: Diffing runtime/machdeps
cvs server: Diffing samples
cvs server: Diffing samples/c_interface
cvs server: Diffing samples/c_interface/c_calls_mercury
cvs server: Diffing samples/c_interface/cplusplus_calls_mercury
cvs server: Diffing samples/c_interface/mercury_calls_c
cvs server: Diffing samples/c_interface/mercury_calls_cplusplus
cvs server: Diffing samples/c_interface/mercury_calls_fortran
cvs server: Diffing samples/c_interface/simpler_c_calls_mercury
cvs server: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs server: Diffing samples/diff
cvs server: Diffing samples/muz
cvs server: Diffing samples/rot13
cvs server: Diffing samples/solutions
cvs server: Diffing samples/tests
cvs server: Diffing samples/tests/c_interface
cvs server: Diffing samples/tests/c_interface/c_calls_mercury
cvs server: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs server: Diffing samples/tests/c_interface/mercury_calls_c
cvs server: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs server: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs server: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs server: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs server: Diffing samples/tests/diff
cvs server: Diffing samples/tests/muz
cvs server: Diffing samples/tests/rot13
cvs server: Diffing samples/tests/solutions
cvs server: Diffing samples/tests/toplevel
cvs server: Diffing scripts
cvs server: Diffing tests
cvs server: Diffing tests/benchmarks
cvs server: Diffing tests/debugger
cvs server: Diffing tests/debugger/declarative
cvs server: Diffing tests/dppd
cvs server: Diffing tests/general
cvs server: Diffing tests/general/accumulator
cvs server: Diffing tests/general/string_format
cvs server: Diffing tests/general/structure_reuse
cvs server: Diffing tests/grade_subdirs
cvs server: Diffing tests/hard_coded
cvs server: Diffing tests/hard_coded/exceptions
cvs server: Diffing tests/hard_coded/purity
cvs server: Diffing tests/hard_coded/sub-modules
cvs server: Diffing tests/hard_coded/typeclasses
cvs server: Diffing tests/invalid
Index: tests/invalid/aditi_update_errors.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/aditi_update_errors.err_exp,v
retrieving revision 1.7
diff -u -r1.7 aditi_update_errors.err_exp
--- tests/invalid/aditi_update_errors.err_exp 17 Jan 2003 05:57:07 -0000 1.7
+++ tests/invalid/aditi_update_errors.err_exp 14 May 2004 08:30:31 -0000
@@ -61,7 +61,7 @@
aditi_update_errors.m:166: In clause for predicate `aditi_update_errors.aditi_update_types/2':
aditi_update_errors.m:166: warning: variable `DB' occurs only once in this scope.
aditi_update_errors.m:007: Error: no clauses for
-aditi_update_errors.m:007: predicate `aditi_update_errors.aditi_update_syntax/2'.
+aditi_update_errors.m:007: predicate `aditi_update_syntax/2'.
aditi_update_errors.m:096: In clause for predicate `aditi_update_errors.aditi_update_types/2':
aditi_update_errors.m:096: error: wrong number of arguments (2; should be 3)
aditi_update_errors.m:096: in call to predicate `p'.
@@ -177,6 +177,5 @@
aditi_update_errors.m:173: in argument 2 of `aditi_bulk_modify' of function `q/2':
aditi_update_errors.m:173: type error: variable `ModifyQ' has type `((aditi_bottom_up func(V_48, int, int, V_51, int)) = int)',
aditi_update_errors.m:173: expected type was `(aditi_bottom_up pred((aditi.state), int, int, (aditi.state), int, int))'.
-aditi_update_errors.m:026: Error: no clauses for
-aditi_update_errors.m:026: predicate `aditi_update_errors.anc/3'.
+aditi_update_errors.m:026: Error: no clauses for predicate `anc/3'.
For more information, try recompiling with `-E'.
Index: tests/invalid/errors2.err_exp2
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/errors2.err_exp2,v
retrieving revision 1.7
diff -u -r1.7 errors2.err_exp2
--- tests/invalid/errors2.err_exp2 19 Mar 2004 10:19:52 -0000 1.7
+++ tests/invalid/errors2.err_exp2 14 May 2004 08:30:31 -0000
@@ -12,9 +12,9 @@
errors2.m:070: warning: variable `Y' occurs only once in this scope.
errors2.m:071: In clause for predicate `errors2.type_error_7/0':
errors2.m:071: warning: variables `Z, A, B' occur only once in this scope.
-errors2.m:007: Error: no clauses for predicate `errors2.bind_type_param/2'.
-errors2.m:023: Error: no clauses for predicate `errors2.produce_string/1'.
-errors2.m:025: Error: no clauses for predicate `errors2.expect_int/1'.
+errors2.m:007: Error: no clauses for predicate `bind_type_param/2'.
+errors2.m:023: Error: no clauses for predicate `produce_string/1'.
+errors2.m:025: Error: no clauses for predicate `expect_int/1'.
errors2.m:031: In clause for predicate `errors2.type_error/0':
errors2.m:031: in argument 1 of call to predicate `expect_int/1':
errors2.m:031: type error: variable `X' has type `string',
Index: tests/invalid/external.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/external.err_exp,v
retrieving revision 1.3
diff -u -r1.3 external.err_exp
--- tests/invalid/external.err_exp 17 Jan 2003 05:57:08 -0000 1.3
+++ tests/invalid/external.err_exp 14 May 2004 08:30:31 -0000
@@ -1,3 +1,3 @@
external.m:012: Warning: `external' declaration requires arity.
-external.m:007: Error: no clauses for predicate `external.p/2'.
+external.m:007: Error: no clauses for predicate `p/2'.
For more information, try recompiling with `-E'.
Index: tests/invalid/ho_unique_error.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/ho_unique_error.err_exp,v
retrieving revision 1.1
diff -u -r1.1 ho_unique_error.err_exp
--- tests/invalid/ho_unique_error.err_exp 14 Jul 1999 07:15:36 -0000 1.1
+++ tests/invalid/ho_unique_error.err_exp 14 May 2004 08:30:32 -0000
@@ -1,3 +1,6 @@
+ho_unique_error.m:007: In `call_ho(di, uo)':
+ho_unique_error.m:007: error: invalid determinism for a predicate with I/O
+ho_unique_error.m:007: state arguments.
ho_unique_error.m:012: In clause for `call_ho(di, uo)':
ho_unique_error.m:012: in argument 3 (i.e. argument 2 of the called predicate) of higher-order predicate call:
ho_unique_error.m:012: mode error: variable `DCG_0' has instantiatedness `mostly_unique',
Index: tests/invalid/magicbox.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/magicbox.err_exp,v
retrieving revision 1.1
diff -u -r1.1 magicbox.err_exp
--- tests/invalid/magicbox.err_exp 1 Apr 2004 04:32:42 -0000 1.1
+++ tests/invalid/magicbox.err_exp 14 May 2004 08:30:32 -0000
@@ -1,4 +1,7 @@
magicbox.m:036: In `arguments_handler(di, uo, out)':
+magicbox.m:036: error: invalid determinism for a predicate with I/O state
+magicbox.m:036: arguments.
+magicbox.m:036: In `arguments_handler(di, uo, out)':
magicbox.m:036: error: determinism declaration not satisfied.
magicbox.m:036: Declared `cc_multi', inferred `cc_nondet'.
magicbox.m:055: call to `to_int(in, out)' can fail.
Index: tests/invalid/missing_det_decls.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/missing_det_decls.err_exp,v
retrieving revision 1.6
diff -u -r1.6 missing_det_decls.err_exp
--- tests/invalid/missing_det_decls.err_exp 17 Jan 2003 05:57:08 -0000 1.6
+++ tests/invalid/missing_det_decls.err_exp 14 May 2004 08:30:32 -0000
@@ -6,12 +6,8 @@
missing_det_decls.m:013: predicate `missing_det_decls.loc1/0'.
missing_det_decls.m:016: Error: no determinism declaration for local
missing_det_decls.m:016: predicate `missing_det_decls.loc2/1'.
-missing_det_decls.m:004: Error: no clauses for
-missing_det_decls.m:004: predicate `missing_det_decls.exp1/0'.
-missing_det_decls.m:007: Error: no clauses for
-missing_det_decls.m:007: predicate `missing_det_decls.exp2/1'.
-missing_det_decls.m:012: Error: no clauses for
-missing_det_decls.m:012: predicate `missing_det_decls.loc1/0'.
-missing_det_decls.m:015: Error: no clauses for
-missing_det_decls.m:015: predicate `missing_det_decls.loc2/1'.
+missing_det_decls.m:004: Error: no clauses for predicate `exp1/0'.
+missing_det_decls.m:007: Error: no clauses for predicate `exp2/1'.
+missing_det_decls.m:012: Error: no clauses for predicate `loc1/0'.
+missing_det_decls.m:015: Error: no clauses for predicate `loc2/1'.
For more information, try recompiling with `-E'.
Index: tests/invalid/mostly_uniq1.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/mostly_uniq1.err_exp,v
retrieving revision 1.11
diff -u -r1.11 mostly_uniq1.err_exp
--- tests/invalid/mostly_uniq1.err_exp 17 Jan 2003 05:57:09 -0000 1.11
+++ tests/invalid/mostly_uniq1.err_exp 14 May 2004 08:30:32 -0000
@@ -1,3 +1,6 @@
+mostly_uniq1.m:005: In `my_main(di, uo)':
+mostly_uniq1.m:005: error: invalid determinism for a predicate with I/O state
+mostly_uniq1.m:005: arguments.
mostly_uniq1.m:018: In clause for `my_main(di, uo)':
mostly_uniq1.m:018: in argument 2 of call to predicate `io.write_int/3':
mostly_uniq1.m:018: mode error: variable `DCG_0' has instantiatedness `mostly_unique',
Index: tests/invalid/mostly_uniq2.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/mostly_uniq2.err_exp,v
retrieving revision 1.9
diff -u -r1.9 mostly_uniq2.err_exp
--- tests/invalid/mostly_uniq2.err_exp 17 Jan 2003 05:57:09 -0000 1.9
+++ tests/invalid/mostly_uniq2.err_exp 14 May 2004 08:30:32 -0000
@@ -1,3 +1,6 @@
+mostly_uniq2.m:005: In `foo(di, uo)':
+mostly_uniq2.m:005: error: invalid determinism for a predicate with I/O state
+mostly_uniq2.m:005: arguments.
mostly_uniq2.m:012: In clause for `foo(di, uo)':
mostly_uniq2.m:012: in argument 2 of call to predicate `io.write_int/3':
mostly_uniq2.m:012: mode error: variable `DCG_0' has instantiatedness `mostly_unique',
Index: tests/invalid/multimode_syntax.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/multimode_syntax.err_exp,v
retrieving revision 1.2
diff -u -r1.2 multimode_syntax.err_exp
--- tests/invalid/multimode_syntax.err_exp 17 Jan 2003 05:57:09 -0000 1.2
+++ tests/invalid/multimode_syntax.err_exp 14 May 2004 08:30:32 -0000
@@ -29,8 +29,7 @@
multimode_syntax.m:045: syntax error: some but not all arguments have mode annotations.
multimode_syntax.m:047: In clause for predicate `multimode_syntax.test2/2':
multimode_syntax.m:047: syntax error: some but not all arguments have mode annotations.
-multimode_syntax.m:011: Error: no clauses for
-multimode_syntax.m:011: function `multimode_syntax.func0/0'.
+multimode_syntax.m:011: Error: no clauses for function `func0/0'.
multimode_syntax.m:013: In clause for predicate `multimode_syntax.::/2':
multimode_syntax.m:013: in argument 1 of clause head:
multimode_syntax.m:013: error: the language construct =/2 should be
Index: tests/invalid/multisoln_func.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/multisoln_func.err_exp,v
retrieving revision 1.4
diff -u -r1.4 multisoln_func.err_exp
--- tests/invalid/multisoln_func.err_exp 5 Apr 2004 05:07:49 -0000 1.4
+++ tests/invalid/multisoln_func.err_exp 14 May 2004 08:30:32 -0000
@@ -1,19 +1,14 @@
multisoln_func.m:026: Inferred :- func test2 = int.
multisoln_func.m:030: Inferred :- func test3(int) = int.
multisoln_func.m:034: Inferred :- func test3b(int) = int.
-multisoln_func.m:013: Error: invalid determinism for
-multisoln_func.m:013: function `multisoln_func.f(in) = out':
+multisoln_func.m:013: Error: invalid determinism for `f(in) = out':
multisoln_func.m:013: the primary mode of a function cannot be `cc_multi'.
-multisoln_func.m:019: Error: invalid determinism for
-multisoln_func.m:019: function `multisoln_func.test() = out':
+multisoln_func.m:019: Error: invalid determinism for `test = out':
multisoln_func.m:019: the primary mode of a function cannot be `cc_multi'.
-multisoln_func.m:026: Error: invalid determinism for
-multisoln_func.m:026: function `multisoln_func.test2() = out':
+multisoln_func.m:026: Error: invalid determinism for `test2 = out':
multisoln_func.m:026: the primary mode of a function cannot be `multi'.
-multisoln_func.m:030: Error: invalid determinism for
-multisoln_func.m:030: function `multisoln_func.test3(in) = out':
+multisoln_func.m:030: Error: invalid determinism for `test3(in) = out':
multisoln_func.m:030: the primary mode of a function cannot be `nondet'.
-multisoln_func.m:034: Error: invalid determinism for
-multisoln_func.m:034: function `multisoln_func.test3b(in) = out':
+multisoln_func.m:034: Error: invalid determinism for `test3b(in) = out':
multisoln_func.m:034: the primary mode of a function cannot be `cc_nondet'.
For more information, try recompiling with `-E'.
Index: tests/invalid/pragma_c_code_dup_var.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/pragma_c_code_dup_var.err_exp,v
retrieving revision 1.5
diff -u -r1.5 pragma_c_code_dup_var.err_exp
--- tests/invalid/pragma_c_code_dup_var.err_exp 17 Jan 2003 05:57:09 -0000 1.5
+++ tests/invalid/pragma_c_code_dup_var.err_exp 14 May 2004 08:30:32 -0000
@@ -1,6 +1,5 @@
pragma_c_code_dup_var.m:019: In `:- pragma foreign_proc' declaration for function `pragma_c_code_dup_var.bread_impl/6':
pragma_c_code_dup_var.m:019: error: variable `Buf' occurs multiple times
pragma_c_code_dup_var.m:019: in the argument list.
-pragma_c_code_dup_var.m:014: Error: no clauses for
-pragma_c_code_dup_var.m:014: function `pragma_c_code_dup_var.bread_impl/7'.
+pragma_c_code_dup_var.m:014: Error: no clauses for function `bread_impl/7'.
For more information, try recompiling with `-E'.
Index: tests/invalid/pragma_c_code_no_det.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/pragma_c_code_no_det.err_exp,v
retrieving revision 1.1
diff -u -r1.1 pragma_c_code_no_det.err_exp
--- tests/invalid/pragma_c_code_no_det.err_exp 17 Nov 1997 05:48:43 -0000 1.1
+++ tests/invalid/pragma_c_code_no_det.err_exp 14 May 2004 08:30:32 -0000
@@ -2,6 +2,7 @@
pragma_c_code_no_det.m:012: error: `:- pragma c_code(...)' for a procedure
pragma_c_code_no_det.m:012: without a determinism declaration.
pragma_c_code_no_det.m:005: In `test(out)':
-pragma_c_code_no_det.m:005: warning: determinism declaration could be tighter.
+pragma_c_code_no_det.m:005: warning: determinism declaration could be
+pragma_c_code_no_det.m:005: tighter.
pragma_c_code_no_det.m:005: Declared `det', inferred `erroneous'.
For more information, try recompiling with `-E'.
Index: tests/invalid/prog_io_erroneous.err_exp2
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/prog_io_erroneous.err_exp2,v
retrieving revision 1.6
diff -u -r1.6 prog_io_erroneous.err_exp2
--- tests/invalid/prog_io_erroneous.err_exp2 19 Mar 2004 10:19:52 -0000 1.6
+++ tests/invalid/prog_io_erroneous.err_exp2 14 May 2004 08:30:32 -0000
@@ -1,5 +1,4 @@
prog_io_erroneous.m:001: Warning: interface for module `prog_io_erroneous' does
prog_io_erroneous.m:001: not export anything.
-prog_io_erroneous.m:012: Error: no clauses for
-prog_io_erroneous.m:012: predicate `prog_io_erroneous.q/2'.
+prog_io_erroneous.m:012: Error: no clauses for predicate `q/2'.
For more information, try recompiling with `-E'.
Index: tests/invalid/qualified_cons_id2.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/qualified_cons_id2.err_exp,v
retrieving revision 1.4
diff -u -r1.4 qualified_cons_id2.err_exp
--- tests/invalid/qualified_cons_id2.err_exp 17 Jan 2003 05:57:09 -0000 1.4
+++ tests/invalid/qualified_cons_id2.err_exp 14 May 2004 08:30:32 -0000
@@ -1,7 +1,8 @@
qualified_cons_id2.m:015: In mode declarations for predicate `qualified_cons_id2.test/2':
qualified_cons_id2.m:015: error: duplicate mode declaration.
qualified_cons_id2.m:016: Here is the conflicting mode declaration.
-qualified_cons_id2.m:015: In `test(in(bound(qualified_cons_id2.yes(ground))), out)':
+qualified_cons_id2.m:015: In `test(in(bound(qualified_cons_id2.yes(ground))),
+qualified_cons_id2.m:015: out)':
qualified_cons_id2.m:015: error: determinism declaration not satisfied.
qualified_cons_id2.m:015: Declared `det', inferred `failure'.
For more information, try recompiling with `-E'.
Index: tests/invalid/record_syntax_errors.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/record_syntax_errors.err_exp,v
retrieving revision 1.10
diff -u -r1.10 record_syntax_errors.err_exp
--- tests/invalid/record_syntax_errors.err_exp 17 Jan 2003 05:57:09 -0000 1.10
+++ tests/invalid/record_syntax_errors.err_exp 14 May 2004 08:30:32 -0000
@@ -19,10 +19,8 @@
record_syntax_errors.m:057: function, for example to check the input to a
record_syntax_errors.m:057: field update, give the field of the constructor a
record_syntax_errors.m:057: different name.
-record_syntax_errors.m:014: Error: no clauses for
-record_syntax_errors.m:014: predicate `record_syntax_errors.dcg_syntax/2'.
-record_syntax_errors.m:016: Error: no clauses for
-record_syntax_errors.m:016: predicate `record_syntax_errors.dcg_syntax_2/2'.
+record_syntax_errors.m:014: Error: no clauses for predicate `dcg_syntax/2'.
+record_syntax_errors.m:016: Error: no clauses for predicate `dcg_syntax_2/2'.
record_syntax_errors.m:042: In clause for predicate `record_syntax_errors.construct_exist_cons/1':
record_syntax_errors.m:042: error: undefined symbol `field2 :=/2'.
record_syntax_errors.m:005: Field `field2' cannot be updated because
Index: tests/invalid/state_vars_test1.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/state_vars_test1.err_exp,v
retrieving revision 1.4
diff -u -r1.4 state_vars_test1.err_exp
--- tests/invalid/state_vars_test1.err_exp 17 Jan 2003 05:57:09 -0000 1.4
+++ tests/invalid/state_vars_test1.err_exp 14 May 2004 08:30:32 -0000
@@ -2,5 +2,6 @@
state_vars_test1.m:023: however !.X may be used here.
state_vars_test1.m:023: In clause for predicate `state_vars_test1.p/2':
state_vars_test1.m:023: warning: variable `X' occurs only once in this scope.
-state_vars_test1.m:022: Warning: the condition of this if-then-else cannot fail.
+state_vars_test1.m:022: Warning: the condition of this if-then-else cannot
+state_vars_test1.m:022: fail.
For more information, try recompiling with `-E'.
Index: tests/invalid/state_vars_test2.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/state_vars_test2.err_exp,v
retrieving revision 1.4
diff -u -r1.4 state_vars_test2.err_exp
--- tests/invalid/state_vars_test2.err_exp 17 Jan 2003 05:57:09 -0000 1.4
+++ tests/invalid/state_vars_test2.err_exp 14 May 2004 08:30:32 -0000
@@ -1,5 +1,6 @@
state_vars_test2.m:023: Error: state variable !:Y is not visible in this context.
state_vars_test2.m:023: In clause for predicate `state_vars_test2.p/2':
state_vars_test2.m:023: warning: variable `Y' occurs only once in this scope.
-state_vars_test2.m:022: Warning: the condition of this if-then-else cannot fail.
+state_vars_test2.m:022: Warning: the condition of this if-then-else cannot
+state_vars_test2.m:022: fail.
For more information, try recompiling with `-E'.
Index: tests/invalid/state_vars_test3.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/state_vars_test3.err_exp,v
retrieving revision 1.6
diff -u -r1.6 state_vars_test3.err_exp
--- tests/invalid/state_vars_test3.err_exp 17 Jan 2003 05:57:09 -0000 1.6
+++ tests/invalid/state_vars_test3.err_exp 14 May 2004 08:30:32 -0000
@@ -2,6 +2,6 @@
state_vars_test3.m:021: without preceding `func' declaration.
state_vars_test3.m:021: Error: !Y cannot be a function result.
state_vars_test3.m:021: You probably meant !.Y or !:Y.
-state_vars_test3.m:015: Error: no clauses for function `state_vars_test3.f/1'.
-state_vars_test3.m:021: Error: no clauses for function `state_vars_test3.f/2'.
+state_vars_test3.m:015: Error: no clauses for function `f/1'.
+state_vars_test3.m:021: Error: no clauses for function `f/2'.
For more information, try recompiling with `-E'.
Index: tests/invalid/typeclass_mode.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/typeclass_mode.err_exp,v
retrieving revision 1.2
diff -u -r1.2 typeclass_mode.err_exp
--- tests/invalid/typeclass_mode.err_exp 17 Jan 2003 05:57:10 -0000 1.2
+++ tests/invalid/typeclass_mode.err_exp 14 May 2004 08:30:32 -0000
@@ -1,4 +1,4 @@
typeclass_mode.m:005: Error: mode declaration for predicate `typeclass_mode.p/1'
typeclass_mode.m:005: without preceding `pred' declaration.
-typeclass_mode.m:005: Error: no clauses for predicate `typeclass_mode.p/1'.
+typeclass_mode.m:005: Error: no clauses for predicate `p/1'.
For more information, try recompiling with `-E'.
Index: tests/invalid/types.err_exp2
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/types.err_exp2,v
retrieving revision 1.7
diff -u -r1.7 types.err_exp2
--- tests/invalid/types.err_exp2 19 Mar 2004 10:19:52 -0000 1.7
+++ tests/invalid/types.err_exp2 14 May 2004 08:30:32 -0000
@@ -5,7 +5,7 @@
types.m:017: without preceding `pred' declaration.
types.m:020: Error: clause for predicate `types.a/1'
types.m:020: without preceding `pred' declaration.
-types.m:005: Error: no clauses for predicate `types.p/1'.
+types.m:005: Error: no clauses for predicate `p/1'.
types.m:012: In clause for predicate `types.q/0':
types.m:012: error: undefined predicate `zzzzzzzz/0'.
types.m:013: In clause for predicate `types.q/0':
@@ -20,7 +20,7 @@
types.m:039: and constant `0'.
types.m:039: variable `X' has type `(some [BarTypeParam] BarTypeParam)',
types.m:039: constant `0' has type `int'.
-types.m:050: Error: no clauses for predicate `types.bar2/1'.
+types.m:050: Error: no clauses for predicate `bar2/1'.
types.m:018: In clause for predicate `types.r/0':
types.m:018: error: undefined predicate `s/0'.
types.m:020: In clause for predicate `types.a/1':
Index: tests/invalid/undef_mode_and_no_clauses.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/undef_mode_and_no_clauses.err_exp,v
retrieving revision 1.2
diff -u -r1.2 undef_mode_and_no_clauses.err_exp
--- tests/invalid/undef_mode_and_no_clauses.err_exp 17 Jan 2003 05:57:10 -0000 1.2
+++ tests/invalid/undef_mode_and_no_clauses.err_exp 14 May 2004 08:30:32 -0000
@@ -1,5 +1,4 @@
undef_mode_and_no_clauses.m:012: In mode declaration for predicate `undef_mode_and_no_clauses.p'/2:
undef_mode_and_no_clauses.m:012: error: undefined mode `result'/1.
-undef_mode_and_no_clauses.m:011: Error: no clauses for
-undef_mode_and_no_clauses.m:011: predicate `undef_mode_and_no_clauses.p/2'.
+undef_mode_and_no_clauses.m:011: Error: no clauses for predicate `p/2'.
For more information, try recompiling with `-E'.
cvs server: Diffing tests/invalid/purity
cvs server: Diffing tests/misc_tests
cvs server: Diffing tests/mmc_make
cvs server: Diffing tests/mmc_make/lib
cvs server: Diffing tests/recompilation
Index: tests/recompilation/typeclass_method_pragma_r.err_exp.2
===================================================================
RCS file: /home/mercury1/repository/tests/recompilation/typeclass_method_pragma_r.err_exp.2,v
retrieving revision 1.2
diff -u -r1.2 typeclass_method_pragma_r.err_exp.2
--- tests/recompilation/typeclass_method_pragma_r.err_exp.2 18 Jan 2003 17:02:10 -0000 1.2
+++ tests/recompilation/typeclass_method_pragma_r.err_exp.2 14 May 2004 08:30:32 -0000
@@ -1,3 +1,4 @@
Recompiling module `typeclass_method_pragma_r':
typeclass `typeclass_method_pragma_r_2.io/1' was modified.
-typeclass_method_pragma_r.m:015: Warning: call to obsolete predicate `typeclass_method_pragma_r_2.output/3'.
+typeclass_method_pragma_r.m:015: Warning: call to obsolete
+typeclass_method_pragma_r.m:015: predicate `typeclass_method_pragma_r_2.output/3'.
cvs server: Diffing tests/tabling
cvs server: Diffing tests/term
cvs server: Diffing tests/valid
cvs server: Diffing tests/warnings
Index: tests/warnings/ambiguous_overloading.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/ambiguous_overloading.exp,v
retrieving revision 1.2
diff -u -r1.2 ambiguous_overloading.exp
--- tests/warnings/ambiguous_overloading.exp 17 Jan 2003 05:57:19 -0000 1.2
+++ tests/warnings/ambiguous_overloading.exp 14 May 2004 08:30:32 -0000
@@ -1,2 +1,2 @@
-ambiguous_overloading.m:015: In clause for predicate `ambiguous_overloading.ambig_overload/1':
+ambiguous_overloading.m:015: In clause for predicate `ambig_overload/1':
ambiguous_overloading.m:015: warning: highly ambiguous overloading.
Index: tests/warnings/duplicate_call.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/duplicate_call.exp,v
retrieving revision 1.2
diff -u -r1.2 duplicate_call.exp
--- tests/warnings/duplicate_call.exp 17 Jan 2003 05:57:19 -0000 1.2
+++ tests/warnings/duplicate_call.exp 14 May 2004 08:30:32 -0000
@@ -1,2 +1,4 @@
-duplicate_call.m:015: Warning: redundant call to predicate `duplicate_call.called/3'.
-duplicate_call.m:014: Here is the previous call to predicate `duplicate_call.called/3'.
+duplicate_call.m:015: Warning: redundant call to
+duplicate_call.m:015: predicate `duplicate_call.called/3'.
+duplicate_call.m:014: Here is the previous call to
+duplicate_call.m:014: predicate `duplicate_call.called/3'.
Index: tests/warnings/duplicate_const.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/duplicate_const.exp,v
retrieving revision 1.1
diff -u -r1.1 duplicate_const.exp
--- tests/warnings/duplicate_const.exp 17 Feb 2003 06:20:06 -0000 1.1
+++ tests/warnings/duplicate_const.exp 14 May 2004 08:30:32 -0000
@@ -1,2 +1,4 @@
-duplicate_const.m:016: Warning: redundant call to predicate `duplicate_const.called/4'.
-duplicate_const.m:015: Here is the previous call to predicate `duplicate_const.called/4'.
+duplicate_const.m:016: Warning: redundant call to
+duplicate_const.m:016: predicate `duplicate_const.called/4'.
+duplicate_const.m:015: Here is the previous call to
+duplicate_const.m:015: predicate `duplicate_const.called/4'.
Index: tests/warnings/infinite_recursion.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/infinite_recursion.exp,v
retrieving revision 1.2
diff -u -r1.2 infinite_recursion.exp
--- tests/warnings/infinite_recursion.exp 28 Apr 1997 00:05:24 -0000 1.2
+++ tests/warnings/infinite_recursion.exp 14 May 2004 08:30:32 -0000
@@ -1,3 +1,6 @@
-infinite_recursion.m:013: Warning: recursive call will lead to infinite recursion.
-infinite_recursion.m:022: Warning: recursive call will lead to infinite recursion.
-infinite_recursion.m:034: Warning: recursive call will lead to infinite recursion.
+infinite_recursion.m:013: Warning: recursive call will lead to infinite
+infinite_recursion.m:013: recursion.
+infinite_recursion.m:022: Warning: recursive call will lead to infinite
+infinite_recursion.m:022: recursion.
+infinite_recursion.m:034: Warning: recursive call will lead to infinite
+infinite_recursion.m:034: recursion.
Index: tests/warnings/simple_code.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/simple_code.exp,v
retrieving revision 1.10
diff -u -r1.10 simple_code.exp
--- tests/warnings/simple_code.exp 17 Jan 2003 05:57:19 -0000 1.10
+++ tests/warnings/simple_code.exp 14 May 2004 08:30:32 -0000
@@ -8,5 +8,6 @@
simple_code.m:028: Warning: the negated goal cannot fail.
simple_code.m:028: Warning: the negated goal cannot succeed.
simple_code.m:033: Warning: the negated goal cannot succeed.
-simple_code.m:039: Warning: call to obsolete predicate `simple_code.obsolete/0'.
+simple_code.m:039: Warning: call to obsolete
+simple_code.m:039: predicate `simple_code.obsolete/0'.
simple_code.m:099: Warning: recursive call will lead to infinite recursion.
Index: tests/warnings/warn_dead_procs.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/warn_dead_procs.exp,v
retrieving revision 1.1
diff -u -r1.1 warn_dead_procs.exp
--- tests/warnings/warn_dead_procs.exp 23 Jul 2003 03:38:17 -0000 1.1
+++ tests/warnings/warn_dead_procs.exp 14 May 2004 08:30:32 -0000
@@ -1,7 +1,4 @@
warn_dead_procs.m:016: Inferred :- pred baz.
-warn_dead_procs.m:008: Warning: predicate `warn_dead_procs.foo/0' mode 0 is
-warn_dead_procs.m:008: never called.
-warn_dead_procs.m:012: Warning: predicate `warn_dead_procs.bar/1' mode 0 is
-warn_dead_procs.m:012: never called.
-warn_dead_procs.m:013: Warning: predicate `warn_dead_procs.bar/1' mode 1 is
-warn_dead_procs.m:013: never called.
+warn_dead_procs.m:008: Warning: predicate `foo/0' mode 0 is never called.
+warn_dead_procs.m:012: Warning: predicate `bar/1' mode 0 is never called.
+warn_dead_procs.m:013: Warning: predicate `bar/1' mode 1 is never called.
Index: tests/warnings/warn_stubs.exp
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/warn_stubs.exp,v
retrieving revision 1.1
diff -u -r1.1 warn_stubs.exp
--- tests/warnings/warn_stubs.exp 21 Feb 2003 01:57:38 -0000 1.1
+++ tests/warnings/warn_stubs.exp 14 May 2004 08:30:32 -0000
@@ -1,3 +1,3 @@
-warn_stubs.m:004: Warning: no clauses for predicate `warn_stubs.main/2'.
-warn_stubs.m:005: Warning: no clauses for predicate `warn_stubs.foo/0'.
-warn_stubs.m:008: Warning: no clauses for predicate `warn_stubs.main2/2'.
+warn_stubs.m:004: Warning: no clauses for predicate `main/2'.
+warn_stubs.m:005: Warning: no clauses for predicate `foo/0'.
+warn_stubs.m:008: Warning: no clauses for predicate `main2/2'.
cvs server: Diffing tools
cvs server: Diffing trace
cvs server: Diffing util
cvs server: Diffing vim
cvs server: Diffing vim/after
cvs server: Diffing vim/ftplugin
cvs server: Diffing vim/syntax
--------------------------------------------------------------------------
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