xref_definition_line(How, Line),
!,
atom_string(Path0, Path).
+sweep_predicate_location_(M, H, P, L) :-
+ '$autoload':library_index(H, M, P0),
+ absolute_file_name(P0, P1, [extensions([pl])]),
+ xref_source(P1, [comments(store)]),
+ xref_defined(P1, H, How),
+ xref_definition_line(How, L),
+ !,
+ atom_string(P1, P).
sweep_predicate_location_(M, H, Path, Line) :-
predicate_property(M:H, file(Path0)),
predicate_property(M:H, line_count(Line)),
*-> Bar is foo
)")))))
+(ert-deftest predicate-location ()
+ "Test `sweeprolog-predicate-location'."
+ (should (sweeprolog-predicate-location "memory_file:new_memory_file/1")))
+
(ert-deftest term-search ()
"Test `sweeprolog-term-search'."
(let ((temp (make-temp-file "sweeprolog-test"