branch: elpa/swift-mode commit 782378c97d235a9031cdac79fa43a842008b7564 Author: ap4y <l...@pisem.net> Commit: ap4y <l...@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() {