branch: elpa/kotlin-mode
commit 8574583b302d0edce29cb5eee7dc3184e620a517
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
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");
+}