diff --git a/pl/consult.yap b/pl/consult.yap index b09edc0d7..805bce585 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -380,6 +380,10 @@ use_module(M,F,Is) :- '$skip_unix_comments'(_). +source_location(FileName, Line) :- + prolog_load_context(file, FileName), + prolog_load_context(term_position,'$stream_position'(_, Line, _, _, _)). + prolog_load_context(_, _) :- nb_getval('$consulting_file',[]), !, fail. prolog_load_context(directory, DirName) :-