mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-20 00:15:27 +00:00
Added initial error checking of promise ex declarations, and adding
Estimated hours taken: 150 Branches: main Added initial error checking of promise ex declarations, and adding the declarations into the HLDS as dummy predicates to leverage off the error checking done for predicates (similarly to how assertions were done). Following this, `promise_exclusive' and `promise_exclusive_exhaustive' declarations are added into a separate table in the HLDS. assertion.m: Moved the pred declaration for assertion__normalise_goal into the interface. goal_util.m: Added a predicate to get the predids of a goal or list of goals. hlds_data.m: hlds_module.m: Added exclusive_table to HLDS, and operations on it. hlds_out.m: Added printing of promise ex declaration error messages (also improves assertion error messages). hlds_pred.m: Change to type `goal_type' to add constructor for general promise declarations (merged with assertions). dead_proc_elim.m: error_util.m: intermod.m: typecheck.m: Updated to handle promise declarations similarly to how assertions were handled. make_hlds.m: Perform initial typechecking of promise ex declarations, then add them to the HLDS as dummy predicates. purity.m: post_typecheck.m: Post typechecking routine to add exclusivity declarations to the exclusive_table.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
%-----------------------------------------------------------------------------%
|
||||
% Copyright (C) 1997-2001 The University of Melbourne.
|
||||
% Copyright (C) 1997-2002 The University of Melbourne.
|
||||
% This file may only be copied under the terms of the GNU General
|
||||
% Public License - see the file COPYING in the Mercury distribution.
|
||||
%-----------------------------------------------------------------------------%
|
||||
@@ -416,9 +416,9 @@ error_util__describe_one_pred_name(Module, PredId, Piece) :-
|
||||
OrigArity is Arity - 1
|
||||
),
|
||||
(
|
||||
pred_info_get_goal_type(PredInfo, assertion)
|
||||
pred_info_get_goal_type(PredInfo, promise(PromiseType))
|
||||
->
|
||||
Piece = "promise"
|
||||
Piece = "`" ++ promise_to_string(PromiseType) ++ "' declaration"
|
||||
;
|
||||
string__int_to_string(OrigArity, ArityPart),
|
||||
string__append_list([
|
||||
|
||||
Reference in New Issue
Block a user