do reexport even when file has already been loaded
This commit is contained in:
parent
493b591b66
commit
52525a5319
@ -257,12 +257,14 @@ load_files(Files,Opts) :-
|
|||||||
'$file_loaded'(Stream, Mod, Imports, TOpts), !,
|
'$file_loaded'(Stream, Mod, Imports, TOpts), !,
|
||||||
'$lf_opt'('$options', TOpts, Opts),
|
'$lf_opt'('$options', TOpts, Opts),
|
||||||
'$lf_opt'('$location', TOpts, ParentF:Line),
|
'$lf_opt'('$location', TOpts, ParentF:Line),
|
||||||
'$loaded'(Stream, UserFile, Mod, ParentF, Line, not_loaded, _File, _Dir, Opts).
|
'$loaded'(Stream, UserFile, Mod, ParentF, Line, not_loaded, _File, _Dir, Opts),
|
||||||
|
'$reexport'( TOpts, UserFile, Imports, Mod ).
|
||||||
'$start_lf'(changed, Mod, Stream, TOpts, UserFile, Imports) :-
|
'$start_lf'(changed, Mod, Stream, TOpts, UserFile, Imports) :-
|
||||||
'$file_unchanged'(Stream, Mod, Imports, TOpts), !,
|
'$file_unchanged'(Stream, Mod, Imports, TOpts), !,
|
||||||
'$lf_opt'('$options', TOpts, Opts),
|
'$lf_opt'('$options', TOpts, Opts),
|
||||||
'$lf_opt'('$location', TOpts, ParentF:Line),
|
'$lf_opt'('$location', TOpts, ParentF:Line),
|
||||||
'$loaded'(Stream, UserFile, Mod, ParentF, Line, changed, _File, _Dir, Opts).
|
'$loaded'(Stream, UserFile, Mod, ParentF, Line, changed, _File, _Dir, Opts),
|
||||||
|
'$reexport'( TOpts, UserFile, Imports, Mod ).
|
||||||
'$start_lf'(_, Mod, Stream, TOpts, File, _) :-
|
'$start_lf'(_, Mod, Stream, TOpts, File, _) :-
|
||||||
'$do_lf'(Mod, Stream, File, TOpts).
|
'$do_lf'(Mod, Stream, File, TOpts).
|
||||||
|
|
||||||
@ -392,13 +394,7 @@ use_module(M,F,Is) :-
|
|||||||
% ( File = '/Users/vsc/Yap/bins/threads/share/Yap/error.pl' -> start_low_level_trace ; stop_low_level_trace ),
|
% ( File = '/Users/vsc/Yap/bins/threads/share/Yap/error.pl' -> start_low_level_trace ; stop_low_level_trace ),
|
||||||
'$lf_opt'(imports, TOpts, Imports),
|
'$lf_opt'(imports, TOpts, Imports),
|
||||||
'$import_to_current_module'(File, ContextModule, Imports, _, TOpts),
|
'$import_to_current_module'(File, ContextModule, Imports, _, TOpts),
|
||||||
'$lf_opt'(reexport, TOpts, Reexport),
|
'$reexport'( TOpts, File, Imports, ContextModule ),
|
||||||
( Reexport == false -> true ;
|
|
||||||
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
|
||||||
'$lf_opt'('$context_module', OldTOpts, OldContextModule),
|
|
||||||
'$import_to_current_module'(File, OldContextModule, Imports, _, TOpts),
|
|
||||||
'$extend_exports'(ContextModule, Imports)
|
|
||||||
),
|
|
||||||
( LC == 0 -> prompt(_,' |: ') ; true),
|
( LC == 0 -> prompt(_,' |: ') ; true),
|
||||||
'$exec_initialisation_goals',
|
'$exec_initialisation_goals',
|
||||||
% format( 'O=~w~n', [Mod=UserFile] ),
|
% format( 'O=~w~n', [Mod=UserFile] ),
|
||||||
@ -582,6 +578,15 @@ initialization(G,OPT) :-
|
|||||||
print_message(Verbosity, loaded(included, Y, Mod, T, H)),
|
print_message(Verbosity, loaded(included, Y, Mod, T, H)),
|
||||||
nb_setval('$included_file',OY).
|
nb_setval('$included_file',OY).
|
||||||
|
|
||||||
|
'$reexport'( TOpts, File, Imports, ContextModule ) :-
|
||||||
|
'$lf_opt'(reexport, TOpts, Reexport),
|
||||||
|
( Reexport == false -> true ;
|
||||||
|
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
||||||
|
'$lf_opt'('$context_module', OldTOpts, OldContextModule),
|
||||||
|
'$import_to_current_module'(File, OldContextModule, Imports, _, TOpts),
|
||||||
|
'$extend_exports'(ContextModule, Imports)
|
||||||
|
).
|
||||||
|
|
||||||
'$do_startup_reconsult'(X) :-
|
'$do_startup_reconsult'(X) :-
|
||||||
( '$access_yap_flags'(15, 0) ->
|
( '$access_yap_flags'(15, 0) ->
|
||||||
'$system_catch'(load_files(X, [silent(true)]), Module, Error, '$Error'(Error))
|
'$system_catch'(load_files(X, [silent(true)]), Module, Error, '$Error'(Error))
|
||||||
|
Reference in New Issue
Block a user