]> git.eshelyaron.com Git - sweep.git/commitdiff
; Exclude grammar rules from regular goal completion
authorEshel Yaron <me@eshelyaron.com>
Mon, 13 Nov 2023 13:11:07 +0000 (14:11 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 13 Nov 2023 13:11:07 +0000 (14:11 +0100)
* sweep.pl (sweep_heads_collection/2): Exclude DCG non-terminals when
completing a regular goal.

sweep.pl

index b5eb37c9326bf1a653a29b2904c7b0a871130bec..3109b99e245a54dea2500ca78badd7560a3c532f 100644 (file)
--- a/sweep.pl
+++ b/sweep.pl
@@ -1288,7 +1288,11 @@ sweep_heads_collection([D,M0,Bef,Aft], Ps) :-
     ->  true
     ;   term_string(M, M0)
     ),
-    sweep_matching_predicates(Bef, Aft, D, M, PIs),
+    sweep_matching_predicates(Bef, Aft, D, M, PIs0),
+    (   D == 0
+    ->  exclude([M:P/A]>>sweep_grammar_rule(M, P, A), PIs0, PIs)
+    ;   PIs = PIs0
+    ),
     maplist(sweep_format_head_(D), PIs, Ps).
 
 sweep_format_head_(D, M:F/A, [S|SP]) :-