emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog ebd42adc30 1/9: ; Recognize ext-quantified goal


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog ebd42adc30 1/9: ; Recognize ext-quantified goal positions as callable
Date: Sat, 7 Oct 2023 10:01:34 -0400 (EDT)

branch: elpa/sweeprolog
commit ebd42adc3087c7006f2d4c1a3801d992b4d3f966
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ; Recognize ext-quantified goal positions as callable
---
 sweep.pl | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/sweep.pl b/sweep.pl
index fa16037f4c..abe7cfe460 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -1008,10 +1008,7 @@ name_variable(N, V) :- V = '$VAR'(N).
 sweep_context_callable([H|T], R) :-
     H = [F0|_],
     atom_string(F, F0),
-    (   xref_op(_, op(1200, _, F))
-    ->  true
-    ;   current_op(1200, _, F)
-    ),
+    op_is_neck(F),
     !,
     (   F == (-->)
     ->  R0 = 2
@@ -1021,6 +1018,12 @@ sweep_context_callable([H|T], R) :-
 sweep_context_callable([_|T], R) :-
     sweep_context_callable(T, R).
 
+op_is_neck(F) :-
+    (   xref_op(_, op(1200, _, F))
+    ->  true
+    ;   current_op(1200, _, F)
+    ).
+
 sweep_context_callable_([], R0, R1, R) :- R is R0 + R1, !.
 sweep_context_callable_([[":"|2]], R0, R1, R) :- R is R0 + R1, !.
 sweep_context_callable_([["("|_]|T], R0, R1, R) :-
@@ -1036,11 +1039,9 @@ sweep_context_callable_([H|T], R0, _, R) :-
     sweep_context_callable_(T, R0, R1, R).
 
 sweep_context_callable_arg((-->), _, 2) :- !.
+sweep_context_callable_arg(^, _, 0) :- !.
 sweep_context_callable_arg(Neck, _, 0) :-
-    (   xref_op(_, op(1200, _, Neck))
-    ->  true
-    ;   current_op(1200, _, Neck)
-    ),
+    op_is_neck(Neck),
     !.
 sweep_context_callable_arg(F, N, R) :-
     sweep_current_module(Mod),



reply via email to

[Prev in Thread] Current Thread [Next in Thread]