From 2cacf6f63aa2311231d188a87ee3504f22b4cc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 21 Feb 2016 11:31:27 +0000 Subject: [PATCH] fix source regression --- pl/boot.yap | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pl/boot.yap b/pl/boot.yap index 9e92b859a..73ae84580 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -570,14 +570,14 @@ number of steps. '$command'(C,VL,Pos,Con) :- current_prolog_flag(strict_iso, true), !, /* strict_iso on */ - '$execute_command'(C,VL,Pos,Con,C). + '$execute_command'(C,VL,Pos,Con,_Source). '$command'(C,VL,Pos,Con) :- ( (Con = top ; var(C) ; C = [_|_]) -> '$execute_command'(C,VL,Pos,Con,C), ! ; % do term expansion expand_term(C, EC), % execute a list of commands - '$execute_commands'(EC,VL,Pos,Con,C), + '$execute_commands'(EC,VL,Pos,Con,_Source), % succeed only if the *original* was at end of file. C == end_of_file ). @@ -713,15 +713,15 @@ number of steps. % module prefixes all over the place, although unnecessarily so. % % @param [in] _G_ is the clause to compile - % @param [in] _Vs_ a list of varables and their name + % @param [in] _Vs_ a list of variables and their name % @param [in] _Pos_ the source-code position % @param [in] _N_ a flag telling whether to add first or last - % @param [in] _Source_ the original clause -'$go_compile_clause'(G,Vs,Pos, Where, Source) :- - '$precompile_term'(G, G0, G1), + % @param [out] _Source_ the user-tranasformed clause +'$go_compile_clause'(G, _Vs, _Pos, Where, Source) :- + '$precompile_term'(G, Source, G1), !, - '$$compile'(G1, Where, G0, _). - '$go_compile_clause'(G,Vs,Pos, Where, Source) :- + '$$compile'(G1, Where, Source, _). + '$go_compile_clause'(G,_Vs,_Pos, _Where, _Source) :- throw(error(system, compilation_failed(G))). '$$compile'(C, Where, C0, R) :- @@ -1423,9 +1423,10 @@ bootstrap(F) :- % return two arguments: Expanded0 is the term after "USER" expansion. % Expanded is the final expanded term. % -'$precompile_term'(Term, Expanded0, Expanded) :- +'$precompile_term'(Term, ExpandedUser, Expanded) :- %format('[ ~w~n',[Term]), - '$expand_clause'(Term, Expanded0, ExpandedI), !, + '$expand_clause'(Term, ExpandedUser, ExpandedI), + !, %format(' -> ~w~n',[Expanded0]), ( current_prolog_flag(strict_iso, true) /* strict_iso on */