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
This commit is contained in:
vsc 2008-08-06 10:15:48 +00:00
parent 2c829f8e5c
commit ea812ad059

View File

@ -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) :-