branch: elpa/sweeprolog
commit b7233ba9b3096df47649ef57a5f8d0a6eac2a858
Author: Eshel Yaron <[email protected]>
Commit: Eshel Yaron <[email protected]>
; 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]) :-