emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-mode e835894584 4/4: Merge pull request #1815 from


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-mode e835894584 4/4: Merge pull request #1815 from barak/master
Date: Fri, 4 Aug 2023 04:00:08 -0400 (EDT)

branch: elpa/haskell-mode
commit e8358945845b15cbcc4c1479e51b5236bac61b72
Merge: 6279e63a89 6201f7c1c0
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #1815 from barak/master
    
    minor fixes made while trying to get debian package working with emacs 29.1
---
 Makefile                      |  2 +-
 doc/haskell-mode.texi         |  4 ++--
 haskell-mode-pkg.el           |  2 +-
 tests/haskell-lexeme-tests.el | 51 ++++++++++---------------------------------
 4 files changed, 15 insertions(+), 44 deletions(-)

diff --git a/Makefile b/Makefile
index a6916754db..d5f72bb0d0 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
 # We should have a script that changes it everywhere it is needed and
 # syncs it with current git tag.
 #
-VERSION = 17.2-git
+VERSION = 17.3
 
 INSTALL_INFO = install-info
 
diff --git a/doc/haskell-mode.texi b/doc/haskell-mode.texi
index 4ecbcc0d61..b78421b77d 100644
--- a/doc/haskell-mode.texi
+++ b/doc/haskell-mode.texi
@@ -2,7 +2,7 @@
 @c %**start of header
 @setfilename haskell-mode.info
 @documentencoding UTF-8
-@settitle Haskell Mode 17.2-git
+@settitle Haskell Mode 17.3
 @c %**end of header
 
 @c Macro used to mark references of defcustom variables
@@ -17,7 +17,7 @@
 @end direntry
 
 @copying
-This manual is for Haskell mode, version 17.2-git
+This manual is for Haskell mode, version 17.3
 
 Copyright @copyright{} 2013-2017 Haskell Mode contributors.
 
diff --git a/haskell-mode-pkg.el b/haskell-mode-pkg.el
index 79692a41ec..c36dd03bbc 100644
--- a/haskell-mode-pkg.el
+++ b/haskell-mode-pkg.el
@@ -1,4 +1,4 @@
-(define-package "haskell-mode" "17.2-git" "A Haskell editing mode"
+(define-package "haskell-mode" "17.3" "A Haskell editing mode"
   '((emacs "25.1"))
   :url "https://github.com/haskell/haskell-mode";
   :keywords '("haskell" "cabal" "ghc" "repl"))
diff --git a/tests/haskell-lexeme-tests.el b/tests/haskell-lexeme-tests.el
index a4802de279..c35e1db402 100644
--- a/tests/haskell-lexeme-tests.el
+++ b/tests/haskell-lexeme-tests.el
@@ -11,47 +11,14 @@
 LINES is a list of strings that will be inserted to a new
 buffer. Then LEXEMES is a list of lexemes that should be found in
 order."
-  (when (get-buffer "*haskell-mode-buffer*")
-    (kill-buffer "*haskell-mode-buffer*"))
-  (save-current-buffer
-    (set-buffer (get-buffer-create "*haskell-mode-buffer*"))
-
-    (when (fboundp 'jit-lock-debug-mode)
-      ;; to see stack traces from inside font-lock
-      (jit-lock-debug-mode))
-
-    ;; Note that all of this should work both in haskell-mode and
-    ;; outside of it. Currently we test only haskell-mode setup.
-    (if literate
-        (haskell-literate-mode)
-      (haskell-mode))
-
-    (if (consp lines-or-contents)
-        (dolist (line lines-or-contents)
-          (insert line)
-          (insert "\n"))
-      (insert lines-or-contents))
-
-    (font-lock-fontify-buffer)
-
-    (goto-char (point-min))
-    (let (current-token
-          (left-lexemes lexemes))
-      (while (haskell-lexeme-looking-at-token)
-        (setq current-token (match-string-no-properties 0))
-        ;; it should be in the list of lexemes at all
-        (should (member current-token lexemes))
-        ;; it should be next in the list
-        (should (equal (car left-lexemes) current-token))
-        (setq left-lexemes (cdr left-lexemes))
-        (goto-char (match-end 0)))
-      (should (equal nil left-lexemes)))))
+  (should (equal (check-lexemes-nocheck lines-or-contents literate)
+                 lexemes)))
 
 (defun check-lexemes-nocheck (lines-or-contents &optional literate)
   "Checks if tokenization works as expected.
 
 LINES is a list of strings that will be inserted to a new
-buffer."
+buffer. Returns list of tokens."
   (when (get-buffer "*haskell-mode-buffer*")
     (kill-buffer "*haskell-mode-buffer*"))
   (save-current-buffer
@@ -77,8 +44,12 @@ buffer."
 
     ;; here we check only if tokenization did not end in exception thrown
     (goto-char (point-min))
-    (while (haskell-lexeme-looking-at-token)
-      (goto-char (match-end 0)))))
+    (let ((rtokens nil))
+      (while (haskell-lexeme-looking-at-token)
+        (push (buffer-substring-no-properties (point) (match-end 0))
+              rtokens)
+        (goto-char (match-end 0)))
+      (nreverse rtokens))))
 
 (ert-deftest haskell-lexeme-classify-chars-1 ()
   (should (equal 'varsym (haskell-lexeme-classify-by-first-char ?=)))
@@ -98,7 +69,7 @@ buffer."
    '(")" "(" "}" "{" "]" "[" "," ";" ";")))
 
 (ert-deftest haskell-lexeme-qid-1 ()
-  "Indentifiers"
+  "Identifiers"
   (check-lexemes
    '("head,at_first,safeHead;Data")
    '("head" "," "at_first" "," "safeHead" ";" "Data")))
@@ -110,7 +81,7 @@ buffer."
    '(">>=" "," "---->" "," "<-" ";" "::::")))
 
 (ert-deftest haskell-lexeme-qid-3 ()
-  "Qualified Indentifiers"
+  "Qualified Identifiers"
   (check-lexemes
    '("Data.List.head,Modu.at_first,Zonk.safeHead;Data.Data")
    '("Data.List.head" "," "Modu.at_first" "," "Zonk.safeHead" ";" 
"Data.Data")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]