From ff846824f7904923e193e6303b5a3c74ed06d69f Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 13 May 2016 11:51:33 +0200 Subject: [PATCH] Set syntax class underscore to symbol constituent --- haskell-mode.el | 2 +- tests/haskell-c2hs-tests.el | 2 +- tests/haskell-font-lock-tests.el | 10 +++++----- tests/haskell-test-utils.el | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index 52bb6d6eb..917581155 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -471,7 +471,7 @@ executable found in PATH.") (modify-syntax-entry ?\t " " table) (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?\' "_" table) - (modify-syntax-entry ?_ "w" table) + (modify-syntax-entry ?_ "_" table) (modify-syntax-entry ?\( "()" table) (modify-syntax-entry ?\) ")(" table) (modify-syntax-entry ?\[ "(]" table) diff --git a/tests/haskell-c2hs-tests.el b/tests/haskell-c2hs-tests.el index 3ac65b2a7..8037febd9 100644 --- a/tests/haskell-c2hs-tests.el +++ b/tests/haskell-c2hs-tests.el @@ -199,7 +199,7 @@ '(("{#" t haskell-c2hs-hook-pair-face) ("set" "w" haskell-c2hs-hook-name-face) ("#}" t haskell-c2hs-hook-pair-face) - ("AF_NET" "w" haskell-constructor-face)) + ("AF_NET" "w_" haskell-constructor-face)) 'haskell-c2hs-mode)) (ert-deftest haskell-c2hs-pointer-hook-1 () diff --git a/tests/haskell-font-lock-tests.el b/tests/haskell-font-lock-tests.el index 398425923..81f0630e6 100644 --- a/tests/haskell-font-lock-tests.el +++ b/tests/haskell-font-lock-tests.el @@ -169,13 +169,13 @@ ("Comm6" "w" font-lock-comment-face) ("Cons7" "w" haskell-constructor-face) ("pragma1" "w" haskell-pragma-face) - ("non_pragma2" "w" font-lock-comment-face) + ("non_pragma2" "w_" font-lock-comment-face) - ("non_pragma3" "w" font-lock-comment-face) - ("liquid_haskell" "w" haskell-liquid-haskell-annotation-face) - ("non_liquid_haskell_2" "w" font-lock-comment-face) + ("non_pragma3" "w_" font-lock-comment-face) + ("liquid_haskell" "w_" haskell-liquid-haskell-annotation-face) + ("non_liquid_haskell_2" "w_" font-lock-comment-face) - ("non_liquid_haskell_3" "w" font-lock-comment-face)))) + ("non_liquid_haskell_3" "w_" font-lock-comment-face)))) (ert-deftest haskell-syntactic-string-vs-comment-escape () diff --git a/tests/haskell-test-utils.el b/tests/haskell-test-utils.el index 76f2db049..fa9c9be9b 100644 --- a/tests/haskell-test-utils.el +++ b/tests/haskell-test-utils.el @@ -64,14 +64,15 @@ If SYNTAX or FACE are set to t then any syntex respective face is not checked." (let (all-syntaxes all-faces + (syntax-classes "-.w_()'\"$\\/<>@!|") (text (buffer-substring-no-properties beg end))) (while (< beg end) - (add-to-list 'all-syntaxes (syntax-class (syntax-after beg))) + (add-to-list 'all-syntaxes (char-to-string (aref syntax-classes (syntax-class (syntax-after beg))))) (add-to-list 'all-faces (get-text-property beg 'face)) (setq beg (1+ beg))) (unless (eq syntax t) - (should (equal (list text (list (syntax-class (string-to-syntax syntax)))) - (list text all-syntaxes)))) + (should (equal (list text (mapconcat #'identity (sort (mapcar (lambda (syn) (char-to-string syn)) syntax) #'string<) "")) + (list text (mapconcat #'identity (sort all-syntaxes #'string<) ""))))) (unless (eq face t) (should (equal (list text (list face)) (list text all-faces))))))