Commit de7724e6 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

BUGFIX error messages should not contain ~

parent cbb987b7
......@@ -174,7 +174,7 @@ list_model_influences :-
).
prolog:error_message(not_an_influence_model) -->
prolog:message(error(not_an_influence_model)) -->
['Not an influence model'].
......
......@@ -635,34 +635,20 @@ inherits(Id, AncestorId) :-
).
prolog:error_message(cannot_inherit_from_itself) -->
[
'Cannot inherit from itself.'
].
prolog:message(error(cannot_inherit_from_itself)) -->
['Cannot inherit from itself.'].
prolog:error_message(already_inherits) -->
[
'There is already such an inheritance relation.'
].
prolog:message(error(already_inherits)) -->
['There is already such an inheritance relation.'].
prolog:error_message(cannot_inherit_from_descendant) -->
[
'Cannot inherit from descendant.'
].
prolog:error_message(
kind_mismatch(Ident, Kind, NeededKind)
) -->
{
format(
atom(Message),
'There is a mismatch between the uses of ~a: ~a and ~a.',
[Ident, Kind, NeededKind]
)
},
[Message].
prolog:message(error(cannot_inherit_from_descendant)) -->
['Cannot inherit from descendant.'].
prolog:message(error(kind_mismatch(Ident, Kind, NeededKind))) -->
['There is a mismatch between the uses of ~a: ~a and ~a.'-[Ident,
Kind, NeededKind]].
inherits_from(Id, AncestorId) :-
......
......@@ -50,17 +50,10 @@ check_identifier_kind(Ident, NeededKind) :-
).
prolog:error_message(
already_defined_with_another_kind(Ident, Kind, NeededKind)
prolog:message(
error(already_defined_with_another_kind(Ident, Kind, NeededKind))
) -->
{
format(
atom(Message),
'~a cannot be ~a because it is already used as ~a.',
[Ident, NeededKind, Kind]
)
},
[Message].
['~a cannot be ~a because it is already used as ~a.'-[Ident, NeededKind, Kind]].
......@@ -76,29 +69,24 @@ check_no_free_identifiers :-
->
true
;
throw(error(not_defined(FreeIdents), check_no_free_identifiers))
throw(error(not_defined(FreeIdents)))
).
prolog:error_message(not_defined(FreeIdents)) -->
prolog:message(error(not_defined(FreeIdents))) -->
{
with_output_to(
atom(Message),
(
FreeIdents = [FreeIdent]
->
format('~a is not defined.', [FreeIdent])
;
write_successes(
member(FreeIdent, FreeIdents),
write(', '),
write(FreeIdent)
),
write(' are not defined.')
)
)
findall('~a', member(_, FreeIdents), As),
atomic_list_concat(As, ', ', Format),
(
FreeIdents = [_]
->
Verb = 'is'
;
Verb = 'are'
),
atomic_list_concat([Format, Verb, 'not defined'], ' ', FullFormat)
},
[Message].
[FullFormat-FreeIdents].
update_identifier_kinds(ModelId) :-
......
......@@ -179,7 +179,7 @@ list_model_reactions :-
).
prolog:error_message(not_a_reaction_model) -->
prolog:message(error(not_a_reaction_model)) -->
['Not a reaction model'].
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment