]> git.eshelyaron.com Git - dict.git/commitdiff
ADDED: sweep_op_info/2: new_predicate
authorEshel Yaron <me@eshelyaron.com>
Wed, 21 Sep 2022 16:30:34 +0000 (19:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 21 Sep 2022 16:31:05 +0000 (19:31 +0300)
sweep.pl

index 8d6297420aae353be2cf3647b3e870efdc394560..4ee0b66978e8126db200f89f9b7820dfdb062e3e 100644 (file)
--- a/sweep.pl
+++ b/sweep.pl
@@ -52,6 +52,7 @@
             sweep_packs_collection/2,
             sweep_pack_install/2,
             sweep_prefix_ops/2,
+            sweep_op_info/2,
             sweep_module_path/2
           ]).
 
@@ -678,6 +679,18 @@ sweep_prefix_ops(Path0, Ops) :-
     maplist(atom_string, Ops0, Ops1),
     list_to_set(Ops1, Ops).
 
+sweep_op_info([Op0|Path0], Info) :-
+    atom_string(Path, Path0),
+    atom_string(Op, Op0),
+    sweep_op_info_(Op, Path, Info).
+
+sweep_op_info_(Op, Path, [Type|Pred]) :-
+    xref_op(Path, op(Pred, Type0, Op)),
+    atom_string(Type0, Type).
+sweep_op_info_(Op, _Path, [Type|Pred]) :-
+    current_op(Pred, Type0, Op),
+    atom_string(Type0, Type).
+
 sweep_load_buffer([String|Path0], Result) :-
     atom_string(Path, Path0),
     with_buffer_stream(Stream,