From 43cad85ace659d2cbf2c952f5ec9de3aaefd7667 Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 4 Mar 2002 15:55:13 +0000 Subject: [PATCH] fix debugging of [-f]. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@398 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/cdmgr.c | 2 ++ pl/debug.yap | 6 ++---- pl/utils.yap | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index 17618cdd7..c3b1baf59 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -2251,6 +2251,8 @@ p_system_pred(void) goto restart_system_pred; } pe = RepPredProp(GetPredPropByFunc(funt, mod)); + } else if (IsPairTerm(t1)) { + return (TRUE); } else return (FALSE); if (EndOfPAEntr(pe)) diff --git a/pl/debug.yap b/pl/debug.yap index 946213701..8e8fb544f 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -347,7 +347,6 @@ debugging :- '$set_creep'(_). %'$spycalls'(G,_) :- write(user_error,'$spycalls'(G)), nl(user_error), fail. -'$spycalls'([_|_],_,_) :- !, fail. '$spycalls'('!'(CP),Mod,_) :- '$call'(!, CP, !,Mod). '$spycalls'(Mod:G,_,Res) :- @@ -383,8 +382,8 @@ debugging :- ). '$spycalls'(G,M,_) :- '$system_predicate'(G,M), - '$flags'(G,M,F,_), - F /\ 0xc00000 =:= 0, % but not meta-predicate or cut transparent +% '$flags'(G,M,F,_), +% F /\ 0xc00000 =:= 0, % but not meta-predicate or cut transparent !, '$spycall_stdpred'(G,M), (true; @@ -812,7 +811,6 @@ debugging :- write(user_error,[chk,L,P,Leap,SP,SC,SL,FS,CL,G]), nl(user_error), fail. */ -'$chk'(_,_,[_|_],_,_) :- !, fail. '$chk'(P,L,G,Mod,SL) :- '$get_value'(spy_leap,Leap), (Leap = 0 -> true; % not leaping diff --git a/pl/utils.yap b/pl/utils.yap index b67871498..7fdb47016 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -194,7 +194,7 @@ rename(Old,New) :- atom(Old), atom(New), !, unix(V) :- var(V), !, throw(error(instantiation_error,unix(V))). -unix(argv(L)) :- (var(L) ; atom(L)), !, '$argv'(L). +unix(argv(L)) :- '$is_list_of_atoms'(L,L), !, '$argv'(L). unix(argv(V)) :- throw(error(type_error(atomic,V),unix(argv(V)))). unix(cd) :- cd('~'). @@ -219,6 +219,22 @@ unix(shell) :- sh. unix(putenv(X,Y)) :- '$putenv'(X,Y). +'$is_list_of_atoms'(V,_) :- var(V),!. +'$is_list_of_atoms'([],_) :- !. +'$is_list_of_atoms'([H|L],L0) :- !, + '$check_if_head_may_be_atom'(H,L0), + '$is_list_of_atoms'(L,L0). +'$is_list_of_atoms'(H,L0) :- + throw(error(type_error(list,H),unix(argv(L0)))). + +'$check_if_head_may_be_atom'(H,L0) :- + var(H), !. +'$check_if_head_may_be_atom'(H,L0) :- + atom(H), !. +'$check_if_head_may_be_atom'(H,L0) :- + throw(error(type_error(atom,H),unix(argv(L0)))). + + '$do_environ'(X, Y) :- var(X), !, throw(error(instantiation_error,unix(environ(X,Y)))).