[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 1122ab9 204/496: Add grammar rule for return st
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 1122ab9 204/496: Add grammar rule for return statement in function |
Date: |
Sun, 29 Aug 2021 11:33:36 -0400 (EDT) |
branch: elpa/swift-mode
commit 1122ab9ded38b233735b5e3a94118a783d54670e
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>
Add grammar rule for return statement in function
---
swift-mode.el | 5 +++--
test/indentation-tests.el | 30 ++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/swift-mode.el b/swift-mode.el
index 3d6881b..967e8d2 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -112,7 +112,8 @@
(decl)
(func-decl))
- (func (func-decl "{" insts "}"))
+ (func-body (insts) ("return" exp))
+ (func (func-decl "{" func-body "}"))
(func-decl ("DECSPEC" "func" func-header)
(func-decl "->" type))
(func-header (id "(" func-params ")"))
@@ -344,7 +345,7 @@
(when (smie-rule-hanging-p)
(if (smie-rule-parent-p "{")
(+ swift-indent-offset swift-indent-multiline-statement-offset)
- swift-indent-multiline-statement-offset)))
+ swift-indent-multiline-statement-offset)))
;; Indent second line of the multi-line class
;; definitions with swift-indent-offset
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index d985869..39ada7c 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -1361,6 +1361,36 @@ let a = a ?
|c
")
+(check-indentation conditional-operator/8
+ "
+func foo() {
+ return order!.deliver ?
+ |OrderViewTableDeliveryCells.lastCellIndex.rawValue :
+ OrderViewTableTakeAwayCells.lastCellIndex.rawValue
+}
+" "
+func foo() {
+ return order!.deliver ?
+ |OrderViewTableDeliveryCells.lastCellIndex.rawValue :
+ OrderViewTableTakeAwayCells.lastCellIndex.rawValue
+}
+")
+
+(check-indentation conditional-operator/9
+ "
+func foo() {
+ return order!.deliver ?
+ OrderViewTableDeliveryCells.lastCellIndex.rawValue :
+ |OrderViewTableTakeAwayCells.lastCellIndex.rawValue
+}
+" "
+func foo() {
+ return order!.deliver ?
+ OrderViewTableDeliveryCells.lastCellIndex.rawValue :
+ |OrderViewTableTakeAwayCells.lastCellIndex.rawValue
+}
+")
+
(check-indentation blank-line/1
"
func foo() {
- [nongnu] elpa/swift-mode c73d653 151/496: Use correct function from cl-lib, (continued)
- [nongnu] elpa/swift-mode c73d653 151/496: Use correct function from cl-lib, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 67fd6a9 160/496: Fix indentation of multiline operator expressions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4b6d6f1 162/496: Add ckruse to the Acknowledgements in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5675e1f 167/496: Merge pull request #65 from ckruse/fix_64, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 94d687d 173/496: Add required ELPA source, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 302e83d 194/496: Distinct generic type parameter from ">" operator when checking for, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 73cdda9 195/496: Don't put implicit semicolon after "(", ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5c31636 200/496: Treat default token as case token, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4ab5f7f 201/496: Add implicit semicolon rule for ?? operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fd228c0 203/496: Improve lexer rule for disctinction between case in switch and enum, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1122ab9 204/496: Add grammar rule for return statement in function,
ELPA Syncer <=
- [nongnu] elpa/swift-mode f193a82 205/496: defcustom types for swift-indent was incorrectly set to intergerp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a60e3fa 209/496: Don't indent chain of operators multiple times, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e539ba6 215/496: Improve support for the multi-line case statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 95e753b 226/496: Disable testing against emacs 24.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e898e7e 234/496: Merge pull request #91 from uk-ar/fix-indent-with-hanging-operator-after-comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a1d7a06 236/496: Merge pull request #88 from uk-ar/fix-indent-after-comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fd9ed20 244/496: Modify indents around comma to meet Xcode spec, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5e7d1b9 250/496: Update swift-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a2c0b6a 251/496: Merge pull request #98 from akoaysigod/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7709e04 256/496: Fix token for DECSPEC, ELPA Syncer, 2021/08/29