[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 0cab4b2 346/496: Fix indentation for catch bloc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 0cab4b2 346/496: Fix indentation for catch blocks without patterns |
Date: |
Sun, 29 Aug 2021 11:34:04 -0400 (EDT) |
branch: elpa/swift-mode
commit 0cab4b2c4b6db68e7f5fb6ee83cacda66da4c4e0
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Fix indentation for catch blocks without patterns
Fixes #138.
```
do
{
}
catch
{
}
```
---
swift-mode-lexer.el | 26 +++++++++++++-------------
test/swift-files/statements.swift | 6 +++++-
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el
index 0f6cee0..78dace9 100644
--- a/swift-mode-lexer.el
+++ b/swift-mode-lexer.el
@@ -194,6 +194,19 @@ END is the point after the token."
'("inout" "throws" "rethrows" "in" "where")))
nil)
+ ;; Inserts semicolon before open curly bracket.
+ ;;
+ ;; Open curly bracket may continue the previous line, but we do not indent
+ ;; there. For example, the code below is parsed as `(foo() { x in ... })'
+ ;; by the Swift compiler, but we indent it like `foo(); { x in ... }'.
+ ;;
+ ;; foo()
+ ;; { // does not indent here
+ ;; x in
+ ;; ...
+ ;; }
+ ((eq (swift-mode:token:type next-token) '\{) t)
+
;; Inserts implicit semicolon around #... directives.
;;
;; Note that we cannot split #if line; the following code is not allowed.
@@ -330,19 +343,6 @@ END is the point after the token."
(swift-mode:forward-token-simple)))
"<")))
- ;; Inserts semicolon before open curly bracket.
- ;;
- ;; Open curly bracket may continue the previous line, but we do not indent
- ;; there. For example, the code below is parsed as `(foo() { x in ... })'
- ;; by the Swift compiler, but we indent it like `foo(); { x in ... }'.
- ;;
- ;; foo()
- ;; { // does not indent here
- ;; x in
- ;; ...
- ;; }
- ((eq (swift-mode:token:type next-token) '\{) t)
-
;; Suppress implicit semicolon after keywords that behave like method
;; names.
;;
diff --git a/test/swift-files/statements.swift
b/test/swift-files/statements.swift
index 9146fa8..308c110 100644
--- a/test/swift-files/statements.swift
+++ b/test/swift-files/statements.swift
@@ -1035,7 +1035,11 @@ catch
foo()
foo()
}
-
+catch
+{
+ foo()
+ foo()
+}
// Conditional control statements
- [nongnu] elpa/swift-mode f9f4bc5 311/496: Fix `beginning/end-of-defun`, (continued)
- [nongnu] elpa/swift-mode f9f4bc5 311/496: Fix `beginning/end-of-defun`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c659c45 329/496: Highlight anchor point for debugging., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b6512fa 325/496: Fix indentation of attributes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1d43501 330/496: Fix indentation of attributes at begging of the buffer., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 193de68 327/496: Fix end-of-defun at eob, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a07be7a 335/496: Fix `swift-mode:beginning-of-defun`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f03db1a 331/496: Fix indentation of switch., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a489024 344/496: indent-new-comment-line: Inherit slashes from the previous line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 75cbae2 345/496: Bump version to 2.2.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 42669da 343/496: Fix indentation for keywords used as parameter names, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0cab4b2 346/496: Fix indentation for catch blocks without patterns,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 92f8eba 349/496: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 2cd111f 351/496: Fix indentation of multiline strings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3bcdf32 353/496: Add more keywords with number sign, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 030b1b8 356/496: Update documentations and wordings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d68af3c 365/496: Update copyright, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 359efc0 379/496: Fix indentation of function parameter clauses, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 25944c2 378/496: Add test for beginning/end-of-defun, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ea029a0 370/496: Suppress implicit semicolons inside interpolated expressions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b5602c1 375/496: Add beginning/end-of-sentence to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 18c3dc4 376/496: Bump version to 4.0.0, ELPA Syncer, 2021/08/29