From ea812ad059a9bb6b7a5f88f9f2a5ce2f0e555723 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 6 Aug 2008 10:15:48 +0000 Subject: [PATCH] fix expand_term to list at end_of_file git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2296 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- pl/boot.yap | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pl/boot.yap b/pl/boot.yap index 50777c14d..e665706d8 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -288,8 +288,12 @@ true :- true. '$command'(C,VL,Con) :- ( (Con = top ; var(C) ; C = [_|_]) -> '$execute_command'(C,VL,Con,C), ! ; + % do term expansion expand_term(C, EC), - '$execute_commands'(EC,VL,Con,C) + % execute a list of commands + '$execute_commands'(EC,VL,Con,C), + % succeed only if the *original* was at end of file. + C == end_of_file ). % @@ -297,7 +301,7 @@ true :- true. % '$execute_commands'(V,_,_,Source) :- var(V), !, '$do_error'(instantiation_error,meta_call(Source)). - '$execute_commands'([],_,_,_) :- !, fail. + '$execute_commands'([],_,_,_) :- !. '$execute_commands'([C|Cs],VL,Con,Source) :- !, ( '$execute_command'(C,VL,Con,Source), @@ -322,15 +326,13 @@ true :- true. '$execute_command'(Command,_,_,_) :- nb_getval('$if_skip_mode',skip), \+ '$if_directive'(Command), - !, - fail. + !. '$execute_command'((:-G),_,Option,_) :- !, '$current_module'(M), % allow user expansion expand_term((:- G), O), O = (:- G1), - '$process_directive'(G1, Option, M), - fail. + '$process_directive'(G1, Option, M). '$execute_command'((?-G),V,_,Source) :- !, '$execute_command'(G,V,top,Source). '$execute_command'(G,V,Option,Source) :-