[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 9e5b8af 190/217: Operator characters ids cannot
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 9e5b8af 190/217: Operator characters ids cannot be adjoint to word constituent ids (#139) |
Date: |
Sun, 29 Aug 2021 11:31:10 -0400 (EDT) |
branch: elpa/scala-mode
commit 9e5b8af0bdfe00787feb76a5c0b74cf37cff8591
Author: Josef Vlach <vlach.josef@gmail.com>
Commit: Sam Halliday <sam.halliday@gmail.com>
Operator characters ids cannot be adjoint to word constituent ids (#139)
---
scala-mode-syntax.el | 17 ++++++++++-------
test/scala-mode-test.el | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el
index f9591da..a37f812 100644
--- a/scala-mode-syntax.el
+++ b/scala-mode-syntax.el
@@ -602,13 +602,16 @@ symbol constituents (syntax 3)."
(defun scala-syntax:propertize-special-symbols (start end)
(save-excursion
- (goto-char start)
- (while (re-search-forward (concat "[" scala-syntax:opchar-group "]"
scala-syntax:op-re) end t)
- (let ((match-beg (match-beginning 0))
- (match-end (match-end 0))
- (match (match-string 0)))
- (unless (member match '("/*" "//" "/**" "</" "*/"))
- (put-text-property match-beg match-end 'syntax-table '(3 .
nil)))))))
+ (goto-char start)
+ (while (re-search-forward (concat "[" scala-syntax:opchar-group "]"
scala-syntax:op-re) end t)
+ (let ((match-beg (match-beginning 0))
+ (match-end (match-end 0))
+ (match (match-string 0)))
+ (unless (or
+ (member match '("/*" "//" "/**" "</" "*/"))
+ (equal 2 (syntax-class (syntax-after match-end)))
+ (equal 2 (syntax-class (syntax-after (1- match-beg)))))
+ (put-text-property match-beg match-end 'syntax-table '(3 . nil)))))))
(defun scala-syntax:propertize-quotedid (start end)
"Mark all `scala-syntax:quotedid-re' as symbol constituents (syntax 3)"
diff --git a/test/scala-mode-test.el b/test/scala-mode-test.el
index 0539170..eb1fb1c 100644
--- a/test/scala-mode-test.el
+++ b/test/scala-mode-test.el
@@ -31,6 +31,7 @@ object Ensime {
('font-lock-comment-face "O")
('font-lock-comment-delimiter-face "D")
('font-lock-doc-face "U")
+ ('font-lock-type-face "T")
(_ "?")))
(ert-deftest smt:syntax-class-and-font-lock-test-1 ()
@@ -68,3 +69,51 @@ object Ensime {
"// val |--| = 123"
"11022203333010222"
"DDDOOOOOOOOOOOOOO"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-7 ()
+ (smt:test
+ "val xs = 1 :: 2 :: Nil"
+ "2220220102033020330222"
+ "KKK-VV-K-C----C----CCC"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-8 ()
+ (smt:test
+ "val xs = 1:: 2 :: Nil"
+ "222022010211020330222"
+ "KKK-VV-K-C---C----CCC"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-9 ()
+ (smt:test
+ "val xs = 1 ::2 :: Nil"
+ "222022010201120330222"
+ "KKK-VV-K-C---C----CCC"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-10 ()
+ (smt:test
+ "case a :: (2) :: Nil"
+ "22220203304250330222"
+ "KKKK-V-TT--C--CC-TTT"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-11 ()
+ (smt:test
+ "abc :<: def"
+ "22203330222"
+ "--------KKK"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-12 ()
+ (smt:test
+ "Foo<T>"
+ "222121"
+ "CCC-C-"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-13 ()
+ (smt:test
+ "class X[T<:Mapper[T]](t: T){}"
+ "22222024211222222425542102545"
+ "KKKKK-T-CKKCCCCCC-C----K-T---"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-14 ()
+ (smt:test
+ "class X[T <: Mapper[T]](t: T){}"
+ "2222202420330222222425542102545"
+ "KKKKK-T-C-KK-CCCCCC-C----K-T---"))
- [nongnu] elpa/scala-mode 8d4d99b 156/217: Add optional flattening to creation of imenu index (again)., (continued)
- [nongnu] elpa/scala-mode 8d4d99b 156/217: Add optional flattening to creation of imenu index (again)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aebed53 168/217: Mark a couple of indentation variables as safe (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ece95ca 170/217: use CI to compile PRs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 37e7537 173/217: rename to scala-mode (#110), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 474a616 175/217: Merge ob-scala into scala-mode (#107), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a0b73b2 177/217: add string interpolation (#116), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4b492b9 179/217: Fix for fill-paragraph (#123), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5ffaa1f 185/217: Merge pull request #129 from ensime/hvesalai-patch-94, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f88091a 191/217: `**` at end of multiline comment cause issue #140 (#141), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 44772cb 196/217: fixed some compilation warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9e5b8af 190/217: Operator characters ids cannot be adjoint to word constituent ids (#139),
ELPA Syncer <=
- [nongnu] elpa/scala-mode a82f186 192/217: Removed duplicated defconst, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode cc960f3 197/217: fixed some markdown syntax mistakes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9d3b56e 206/217: Merge pull request #161 from Kazark/scala3-keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a4ed6b4 073/217: Merge pull request #28 from non/bug/fix-colon-operators, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 27459c3 080/217: Merge pull request #32 from evnm/insert-asterisk-in-multiline-comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e0341e9 199/217: Recognize worksheets as scala files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1ab5f64 212/217: fix comment indenting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2f7b335 065/217: Fixes indenting of else body, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5299b4a 205/217: feat: add Scala 3 soft keywords (as regular keywords), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4014cf6 215/217: Don't make post-self-insert-hook local variable., ELPA Syncer, 2021/08/29