fix module exp in user
This commit is contained in:
parent
2c5fa4a65e
commit
7ea6d84300
@ -959,22 +959,34 @@ most files in the library are from the Edinburgh Prolog library.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
prolog_load_context(directory, DirName) :-
|
prolog_load_context(directory, DirName) :-
|
||||||
source_location(F, _),
|
( source_location(F, _)
|
||||||
file_directory_name(F, DirName).
|
-> file_directory_name(F, DirName) ;
|
||||||
|
working_directory( DirName, DirName )
|
||||||
|
).
|
||||||
prolog_load_context(file, FileName) :-
|
prolog_load_context(file, FileName) :-
|
||||||
source_location(FileName, _).
|
( source_location(FileName, _)
|
||||||
|
->
|
||||||
|
true
|
||||||
|
;
|
||||||
|
FileName = user_input
|
||||||
|
).
|
||||||
prolog_load_context(module, X) :-
|
prolog_load_context(module, X) :-
|
||||||
'$nb_getval'('$consulting_file', _, fail),
|
'$nb_getval'('$consulting_file', _, fail),
|
||||||
'$current_module'(X).
|
'$current_module'(X).
|
||||||
prolog_load_context(source, F0) :-
|
prolog_load_context(source, F0) :-
|
||||||
source_location(F0, _) /*,
|
( source_location(F0, _) /*,
|
||||||
'$input_context'(Context),
|
'$input_context'(Context),
|
||||||
'$top_file'(Context, F0, F) */.
|
'$top_file'(Context, F0, F) */
|
||||||
|
->
|
||||||
|
true
|
||||||
|
;
|
||||||
|
F0 = user_input
|
||||||
|
).
|
||||||
prolog_load_context(stream, Stream) :-
|
prolog_load_context(stream, Stream) :-
|
||||||
'$nb_getval'('$consulting_file', _, fail),
|
'$nb_getval'('$consulting_file', _, fail),
|
||||||
'$current_loop_stream'(Stream).
|
'$current_loop_stream'(Stream).
|
||||||
prolog_load_context(term_position, Position) :-
|
prolog_load_context(term_position, Position) :-
|
||||||
'$current_loop_stream'(Stream),
|
'$current_loop_stream'(Stream),
|
||||||
stream_property(Stream, position(Position) ).
|
stream_property(Stream, position(Position) ).
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user