[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog b7233ba9b3 2/5: ; Exclude grammar rules from re
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog b7233ba9b3 2/5: ; Exclude grammar rules from regular goal completion |
Date: |
Tue, 14 Nov 2023 07:00:25 -0500 (EST) |
branch: elpa/sweeprolog
commit b7233ba9b3096df47649ef57a5f8d0a6eac2a858
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; Exclude grammar rules from regular goal completion
* sweep.pl (sweep_heads_collection/2): Exclude DCG non-terminals when
completing a regular goal.
---
sweep.pl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sweep.pl b/sweep.pl
index b5eb37c932..3109b99e24 100644
--- 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]) :-