* sweep.pl (explicit_args_/3): Check whether G0 is an atom.
* sweeprolog-tests.el (eldoc-dcg-atom): Test it.
atom(G),
!.
explicit_args_(N, G0, G) :-
- compound_name_arguments(G0, F, A0),
+ ( atom(G0)
+ -> F = G0, A0 = []
+ ; compound_name_arguments(G0, F, A0)
+ ),
length(A1, N),
append(A0, A1, A),
compound_name_arguments(G, F, A).
Doit.
" (cons 4 15)))))
+(sweeprolog-deftest eldoc-dcg-atom ()
+ "Test `sweep_short_documentation/2' with atom non-terminals."
+ "
+:- module(eldocdcgatom, []).
+
+:- use_module(library(dcg/basics)).
+"
+ (should (equal (sweeprolog--query-once
+ "sweep" "sweep_short_documentation"
+ (list "bar --> blanks." 9 (buffer-file-name)))
+ (list "dcg_basics:blanks//0" "blanks// is det.
+ Skip zero or more white-space characters.
+" nil))))
+
+
;;; sweeprolog-tests.el ends here