From ed608db28245cce7c56a4d35d4a92f04eb56cdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 6 Aug 2014 10:25:08 -0500 Subject: [PATCH] make goal expansion more readable --- library/maputils.yap | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/library/maputils.yap b/library/maputils.yap index 4fd66a5a8..262bacc10 100644 --- a/library/maputils.yap +++ b/library/maputils.yap @@ -25,7 +25,7 @@ number_of_expansions(0). compile_aux([Clause|Clauses], Module) :- - % compile the predicat declaration if needed + % compile the predicate declaration if needed ( Clause = (Head :- _) ; Clause = Head ), !, @@ -68,8 +68,15 @@ aux_args([Arg|Args], [Arg|MVars], [PVar|PArgs], [PVar|PVars], ['_'|ProtoArgs]) : aux_args(Args, MVars, PArgs, PVars, ProtoArgs). pred_name(Macro, Arity, _ , Name) :- + prolog_load_context(file, FullFileName), + file_base_name( FullFileName, File ), + prolog_load_context(term_position, Pos), + stream_position_data( line_count, Pos, Line ), !, transformation_id(Id), - atomic_concat(['$$$__Auxiliary_predicate__ for ',Macro,'/',Arity,' ',Id], Name). + atomic_concat(['$$$ for ',Macro,'/',Arity,', line ',Line,' in ',File,' ',Id], Name). +pred_name(Macro, Arity, _ , Name) :- + transformation_id(Id), + atomic_concat(['$$$__expansion__ for ',Macro,'/',Arity,' ',Id], Name). transformation_id(Id) :- retract(number_of_expansions(Id)), @@ -102,4 +109,4 @@ goal_expansion_allowed :- /** @} -*/ \ No newline at end of file +*/