(sweeprolog-end-of-top-term)
(should (= (point) 466)))
+(sweeprolog-deftest end-of-top-term-with-dot-char-literal ()
+ "Tests detecting the fullstop in presence of `0\'.'."
+ "
+full_stop_after(Index, String, [H|T]) :-
+ string_code(Index, String, H),
+ Index2 is Index+1,
+ ( code_type(H, space)
+ -> !, full_stop_after(Index2, String, T)
+ ; H == 0'.
+ -> !, layout_after(Index2, String, T)
+ ).
+full_stop_after(_, _, []).
+"
+ (goto-char (point-min))
+ (sweeprolog-end-of-top-term)
+ (should (= (point) 242)))
+
(sweeprolog-deftest fullstop-detection ()
"Tests detecting the fullstop in presence of confusing comments."
"
(ppre (sweeprolog-op-prefix-precedence op)))
(cond
((and (string= "." op)
+ (equal 1 (sweeprolog-syntax-class-at obeg))
(let ((sa (sweeprolog-syntax-class-at (1+ obeg))))
(or (null sa) (member sa '(0 12)))))
nil)
(or (re-search-forward (rx "." (or white "\n")) nil t)
(goto-char (point-max)))
(while (and (or (nth 8 (syntax-ppss))
+ (equal 0 (sweeprolog-syntax-class-at (point)))
(save-excursion
(nth 8 (syntax-ppss (max (point-min)
(1- (point))))))