[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode a84f5c8 460/496: Support multi-parttern catch c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode a84f5c8 460/496: Support multi-parttern catch clauses |
Date: |
Sun, 29 Aug 2021 11:34:28 -0400 (EDT) |
branch: elpa/swift-mode
commit a84f5c82f7aa832746e8dc2417ba53f58bb85daa
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Support multi-parttern catch clauses
https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md
---
swift-mode-indent.el | 13 ++++++++--
test/swift-files/indent/statements.swift | 44 ++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/swift-mode-indent.el b/swift-mode-indent.el
index 3fc0258..bc7793b 100644
--- a/swift-mode-indent.el
+++ b/swift-mode-indent.el
@@ -1137,10 +1137,19 @@ comma at eol."
;; , E
;; , F
;; }
+ ;;
+ ;;
https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md
+ ;; do {
+ ;; } catch Foo(let a),
+ ;; Bar(let a) {
+ ;; foo(a)
+ ;; }
(let ((pos (point))
(parent (swift-mode:backward-sexps-until
;; Includes "if" to stop at the last else-if.
- (append swift-mode:statement-parent-tokens '("if" \( \[ <))
+ ;; Includes "catch" to stop at the last catch.
+ (append swift-mode:statement-parent-tokens
+ '("if" "catch" \( \[ <))
(if utrecht-style nil '(\,))
(if utrecht-style '(\,) nil))))
(cond
@@ -1151,7 +1160,7 @@ comma at eol."
(goto-char pos)
(swift-mode:backward-sexps-until '(< "where")))
- ((equal (swift-mode:token:text parent) "if")
+ ((member (swift-mode:token:text parent) '("if" "catch"))
parent)
(t
diff --git a/test/swift-files/indent/statements.swift
b/test/swift-files/indent/statements.swift
index efc72ae..fa3cbab 100644
--- a/test/swift-files/indent/statements.swift
+++ b/test/swift-files/indent/statements.swift
@@ -1041,6 +1041,50 @@ catch
foo()
}
+// Multi-Pattern Catch Clauses
+//
https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md
+
+do {
+} catch Foo(let a)
+ where
+ foo
+ .bar(),
+ Bar(let a)
+ where
+ foo
+ .bar(),
+ Baz(let a) where
+ foo
+ .bar() {
+ foo(a)
+} catch Foo(let a)
+ where
+ foo
+ .bar()
+ , Bar(let a)
+ where
+ foo
+ .bar()
+ , Baz(let a) where
+ foo
+ .bar() {
+ foo(a)
+} catch
+ Foo(let a)
+ where
+ foo
+ .bar(),
+ Bar(let a)
+ where
+ foo
+ .bar(),
+ Baz(let a) where
+ foo
+ .bar() {
+ foo(a)
+}
+
+
// Conditional control statements
func foo() {
- [nongnu] elpa/swift-mode 56ee9b2 359/496: Add comment style option, (continued)
- [nongnu] elpa/swift-mode 56ee9b2 359/496: Add comment style option, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode dba539e 394/496: Tweak and clean-up font-lock, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode dca378a 400/496: Rename constants, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c532c1e 402/496: Update documents, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d35275b 417/496: Remove unused variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8a7be9c 424/496: Use remap for keymap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 56e21f8 427/496: Simplify autoloads, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 922dc52 445/496: Fix code format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b260308 451/496: Declare local variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1268425 455/496: Add links to various formatters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a84f5c8 460/496: Support multi-parttern catch clauses,
ELPA Syncer <=
- [nongnu] elpa/swift-mode edec7d5 471/496: Suppress a doccheck warning for old versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b93b97e 466/496: Bump version to 8.1.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0bc8d8d 477/496: Use isAvailable when reading simctl device JSON, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 800efe2 496/496: Fix tags of customization, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 370caa7 494/496: Update copyright notices, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 69b8934 080/496: Update readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 37fb4d0 119/496: Release 0.2.0, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ca6437a 116/496: Merge pull request #29 from ap4y/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 79622d7 123/496: Merge pull request #32 from ap4y/fix_nested_multi_line_comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7826550 124/496: Fix code alignment, ELPA Syncer, 2021/08/29