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

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

[nongnu] elpa/swift-mode 4e615b7 143/496: Merge pull request #50 from ap


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 4e615b7 143/496: Merge pull request #50 from ap4y/string_interpolation_all_op
Date: Sun, 29 Aug 2021 11:33:24 -0400 (EDT)

branch: elpa/swift-mode
commit 4e615b7048df00f2f35217181fbd1c6848a1c751
Merge: 2d478bf ce72472
Author: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Merge pull request #50 from ap4y/string_interpolation_all_op
    
    Make all possible operators allowed in string interpolation
---
 swift-mode.el           | 2 +-
 test/font-lock-tests.el | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/swift-mode.el b/swift-mode.el
index f16fbe9..609b686 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -426,7 +426,7 @@
     (remove-text-properties start end '(swift-interpolation-match-data))
     (funcall
      (syntax-propertize-rules
-      ((rx (group "\\(" (* (any alnum " " "(" ")" "+" "-" "*" "/" "_" ".")) 
")"))
+      ((rx (group "\\(" (* (any alnum " ()+-._/*[]!?<>&~!:|^%")) ")"))
        (0 (ignore (swift-syntax-propertize-interpolation)))))
      start end)))
 
diff --git a/test/font-lock-tests.el b/test/font-lock-tests.el
index 169b90f..d4e5484 100644
--- a/test/font-lock-tests.el
+++ b/test/font-lock-tests.el
@@ -192,6 +192,9 @@ test will fail."
 (check-face string-interpolation/has-variable-face/4 
font-lock-variable-name-face "\"\\\(bar\(1\){{ + baz\(2\)\)}}\"")
 (check-face string-interpolation/has-variable-face/5 
font-lock-variable-name-face "\"foo {{\\\(bar_baz)}}\"")
 (check-face string-interpolation/has-variable-face/6 
font-lock-variable-name-face "\"foo {{\\\(bar.baz)}}\"")
+(check-face string-interpolation/has-variable-face/7 
font-lock-variable-name-face "\"foo {{\\\(bar[0])}}\"")
+(check-face string-interpolation/has-variable-face/8 
font-lock-variable-name-face "\"foo {{\\\(bar!.baz)}}\"")
+(check-face string-interpolation/has-variable-face/9 
font-lock-variable-name-face "\"foo {{\\\(bar?.baz)}}\"")
 (check-face string-interpolation/after-has-string-face/2 font-lock-string-face 
"\"(foo \\\(bar){{baz}}\")")
 
 (check-face self/has-keyword-face/1 font-lock-keyword-face "{{self}}.foo")



reply via email to

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