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

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

[nongnu] elpa/swift-mode 782378c 214/496: Correct regex in lexer for the


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 782378c 214/496: Correct regex in lexer for the "default" keyword
Date: Sun, 29 Aug 2021 11:33:38 -0400 (EDT)

branch: elpa/swift-mode
commit 782378c97d235a9031cdac79fa43a842008b7564
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>

    Correct regex in lexer for the "default" keyword
---
 swift-mode.el             |  4 ++--
 test/indentation-tests.el | 11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/swift-mode.el b/swift-mode.el
index 420bb09..04be414 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -254,7 +254,7 @@
    ((looking-at swift-smie--access-modifier-regexp)
     (goto-char (match-end 0)) "ACCESSMOD")
 
-   ((looking-at "default")
+   ((looking-at "\\<default\\>")
     (goto-char (match-end 0)) "case")
 
    (t (let ((tok (smie-default-forward-token)))
@@ -297,7 +297,7 @@
      ((looking-back swift-smie--access-modifier-regexp (- (point) 8) t)
       (goto-char (match-beginning 0)) "ACCESSMOD")
 
-     ((looking-back "default" (- (point) 7) t)
+     ((looking-back "\\<default\\>" (- (point) 9) t)
       (goto-char (match-beginning 0)) "case")
 
      (t (let ((tok (smie-default-backward-token)))
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index d9816cc..bbea69c 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -1200,6 +1200,17 @@ let foo = a +
           |d
 ")
 
+(check-indentation indents-multiline-expressions/23
+                   "
+let x = bar
+        .buz() ??
+|defaultValue
+" "
+let x = bar
+        .buz() ??
+        |defaultValue
+")
+
 (check-indentation indents-long-parameters/1
                    "
 func foo() {



reply via email to

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