bound to ~C-c C-`~. With a prefix argument, calls
~flymake-show-project-diagnostics~ instead.
+** Fixed bug in end of a clause detection in presence of ~=..~
+
+This version includes a fix in ~sweeprolog-end-of-top-term~, which is
+used to locate the end of the current clause. Previously this
+function would get "confused" by occurrences of the ~=../2~ ("univ")
+operator in the clause's body.
+
* Version 0.5.4 on 2022-10-09
** The manual now has a short description attached to each section
moving to the next predicate definition and ~C-c C-p~ for moving to
the previous.
-- Integrate with ~flymake~ to provide on-the-fly diagnostics :: ~sweeprolog-mode~
- should integrate with ~flymake~ to provide diagnostics and feedback
- for errors in Prolog code in an Emacs-standard manner.
-
- Improve the information provided for predicate completion candidates :: predicate
completion with ~C-M-i~ should annotate each completion candidate with
the names and modes of its arguments, when available. E.g. say
(should (equal (sweeprolog-next-solution) nil))
(should (equal (sweeprolog-cut-query) t)))
+(ert-deftest end-of-top-term-with-univ ()
+ "Tests detecting the fullstop in presence of `=..'."
+ (with-temp-buffer
+ (sweeprolog-mode)
+ (insert "
+html_program_section(Section, Dict) -->
+ { _{module:M, options:Options} :< Dict,
+ Content = Dict.get(Section),
+ Content \= [],
+ scasp_code_section_title(Section, Default, Title),
+ Opt =.. [Section,true],
+ option(Opt, Options, Default)
+ },
+ !,
+ html(h2(Title)),
+ ( {Section == query}
+ -> {ovar_set_bindings(Dict.bindings)},
+ html_query(M:Content, Options)
+ ; sequence(predicate_r(M:Options), Content)
+ ).
+")
+ (goto-char (point-min))
+ (sweeprolog-end-of-top-term)
+ (should (= (point) 466))))
+
(ert-deftest fullstop-detection ()
"Tests detecting the fullstop in presence of confusing comments."
(while (and (or (nth 8 (syntax-ppss))
(save-excursion
(nth 8 (syntax-ppss (max (point-min)
- (1- (point)))))))
+ (1- (point))))))
+ (save-match-data
+ (looking-back (rx "=.." (or white "\n"))
+ (line-beginning-position))))
(not (eobp)))
(while (and (nth 8 (syntax-ppss)) (not (eobp)))
(forward-char))