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

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

[nongnu] elpa/kotlin-mode 8574583b30 105/162: Fix highlighting escaped i


From: ELPA Syncer
Subject: [nongnu] elpa/kotlin-mode 8574583b30 105/162: Fix highlighting escaped identifiers in interpolations
Date: Sat, 29 Jan 2022 08:25:27 -0500 (EST)

branch: elpa/kotlin-mode
commit 8574583b302d0edce29cb5eee7dc3184e620a517
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>

    Fix highlighting escaped identifiers in interpolations
---
 kotlin-mode.el | 8 +++++---
 test/sample.kt | 9 ++++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/kotlin-mode.el b/kotlin-mode.el
index 8b6e68e872..4cd7251f66 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -294,10 +294,12 @@
     (remove-text-properties start end '(kotlin-property--interpolation))
     (funcall
      (syntax-propertize-rules
-      ((let ((identifier '(any alnum " !%&()*+-./:<>?[]^_|~")))
+      ((let ((identifier '(or
+                           (and alpha (* alnum))
+                           (and "`" (+ (not (any "`\n"))) "`"))))
          (rx-to-string
-          `(or (group "${" (* ,identifier) "}")
-               (group "$" (+ ,identifier)))))
+          `(or (group "${" ,identifier "}")
+               (group "$" ,identifier))))
        (0 (ignore (kotlin-mode--syntax-propertize-interpolation)))))
      start end)))
 
diff --git a/test/sample.kt b/test/sample.kt
index c64907fd47..069c879711 100644
--- a/test/sample.kt
+++ b/test/sample.kt
@@ -710,4 +710,11 @@ class Test {
     fun f() {
 
     }
-}
\ No newline at end of file
+}
+
+fun itpl() {
+    print("$foo/bar");
+    print("$`weird$! identifier`bar");
+    print("${foo}bar");
+    print("${`weird$! identifier`}bar");
+}



reply via email to

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