[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/tuareg f929e34 2/2: Skip ; ; even on a separate line (fixe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/tuareg f929e34 2/2: Skip ; ; even on a separate line (fixes #259) |
Date: |
Wed, 25 Aug 2021 06:57:33 -0400 (EDT) |
branch: elpa/tuareg
commit f929e34c327e25c783995e3c1d72c5153c779468
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Christophe Troestler <christophe.Troestler@umons.ac.be>
Skip ;; even on a separate line (fixes #259)
This allows repeated `tuareg-eval-phrase` to execute phrases in
sequence without the user needing to do anything in-between.
---
tuareg-tests.el | 21 +++++++++++++++++----
tuareg.el | 3 ++-
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/tuareg-tests.el b/tuareg-tests.el
index a85e9f6..e6e27b2 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -248,8 +248,8 @@ Returns the value of the last FORM."
(let p3a (point))
(insert "and tb = C\n"
" | D of ta\n")
- (let p3b (point))
(insert ";;\n")
+ (let p3b (point))
(goto-char (point-min))
(end-of-defun)
@@ -336,12 +336,19 @@ Returns the value of the last FORM."
(tuareg--lets
(insert "let _ = tata 3 ;;\n")
(let p1 (point))
- (insert "let _ = titi 4 ;;\n")
- (let p2 (point))
(insert "abc def ;;\n")
+ (let p2 (point))
+ (insert "let _ = tata 3\n"
+ ";;\n")
(let p3 (point))
- (insert "ghi jkl ;;\n")
+ (insert "ghi jkl\n"
+ ";;\n")
(let p4 (point))
+ (insert "type spell =\n"
+ " | Frotz\n"
+ " | Xyzzy\n"
+ ";;\n")
+ (let p5 (point))
(goto-char (point-min))
(end-of-defun)
@@ -352,6 +359,10 @@ Returns the value of the last FORM."
(should (equal (point) p3))
(end-of-defun)
(should (equal (point) p4))
+ (end-of-defun)
+ (should (equal (point) p5))
+ (beginning-of-defun)
+ (should (equal (point) p4))
(beginning-of-defun)
(should (equal (point) p3))
(beginning-of-defun)
@@ -371,6 +382,8 @@ Returns the value of the last FORM."
(list p2 (1- p3) (1- p3))))
(should (equal (tuareg-discover-phrase p3)
(list p3 (1- p4) (1- p4))))
+ (should (equal (tuareg-discover-phrase p4)
+ (list p4 (1- p5) (1- p5))))
)))
(ert-deftest tuareg-class-type ()
diff --git a/tuareg.el b/tuareg.el
index 6a75d4a..afb7ebf 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -2532,7 +2532,8 @@ Return a non-nil value if a comment was skipped."
(defun tuareg--skip-forward-comments-semicolon ()
"Skip ';;' and then 'sticky' comments after a definition."
- (skip-chars-forward " \t;")
+ (when (looking-at (rx (* (in " \t\n")) ";;"))
+ (goto-char (match-end 0)))
(while (tuareg--skip-forward-comment)))
(defvar-local tuareg-smie--forward-and-cache nil