[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 9e220cb 2/4: Support nonisolated/isolated
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 9e220cb 2/4: Support nonisolated/isolated |
Date: |
Sat, 25 Sep 2021 00:58:12 -0400 (EDT) |
branch: elpa/swift-mode
commit 9e220cbb15dad2b0342dabe57f9964888694ffd5
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Support nonisolated/isolated
https://github.com/apple/swift-evolution/blob/main/proposals/0313-actor-isolation-control.md
---
swift-mode-font-lock.el | 2 +-
swift-mode-lexer.el | 9 +++++----
test/swift-files/indent/declarations.swift | 6 +++++-
test/swift-files/indent/identifiers.swift | 6 ++++++
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/swift-mode-font-lock.el b/swift-mode-font-lock.el
index 8d25e53..4b9c875 100644
--- a/swift-mode-font-lock.el
+++ b/swift-mode-font-lock.el
@@ -541,7 +541,7 @@ Return nil otherwise."
'("associatedtype" "class" "deinit" "enum" "extension" "fileprivate" "func"
"import" "init" "inout" "internal" "let" "open" "operator" "private"
"protocol" "public" "some" "static" "struct" "subscript" "typealias" "var"
- "actor")
+ "actor" "nonisolated" "isolated")
"Keywords used in declarations.")
(defconst swift-mode:statement-keywords
diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el
index 14165f2..b0ecfcd 100644
--- a/swift-mode-lexer.el
+++ b/swift-mode-lexer.el
@@ -431,9 +431,10 @@ Return nil otherwise."
;; Suppress implicit semicolon around keywords that cannot start or end
;; statements.
(member (swift-mode:token:text previous-token)
- '("some" "inout" "in" "where"))
+ '("some" "inout" "in" "where" "isolated"))
(member (swift-mode:token:text next-token)
- '("some" "inout" "throws" "rethrows" "async" "in" "where")))
+ '("some" "inout" "throws" "rethrows" "in" "where"
+ "isolated")))
nil)
;; Inserts semicolon before open curly bracket.
@@ -458,7 +459,7 @@ Return nil otherwise."
'("indirect" "convenience" "dynamic" "final" "infix" "lazy"
"mutating" "nonmutating" "optional" "override" "postfix"
"prefix" "required" "static" "unowned" "weak" "internal"
- "private" "public" "open" "fileprivate"))
+ "private" "public" "open" "fileprivate" "nonisolated"))
nil)
;; internal(set) private(set) public(set) open(set) fileprivate(set)
@@ -491,7 +492,7 @@ Return nil otherwise."
'("indirect" "convenience" "dynamic" "final" "infix" "lazy"
"mutating" "nonmutating" "optional" "override" "postfix"
"prefix" "required" "static" "unowned" "weak" "internal"
- "private" "public" "open" "fileprivate"))
+ "private" "public" "open" "fileprivate" "nonisolated"))
t)
;; Inserts implicit semicolon around keywords that forms single keyword
diff --git a/test/swift-files/indent/declarations.swift
b/test/swift-files/indent/declarations.swift
index 52cd3b5..2934376 100644
--- a/test/swift-files/indent/declarations.swift
+++ b/test/swift-files/indent/declarations.swift
@@ -338,6 +338,9 @@ private
B>
(
x:
+ @A
+ isolated
+ inout
Int,
y:
Int
@@ -620,7 +623,8 @@ fileprivate
B =
D<E> {
func foo()
- func foo()
+ nonisolated
+ func foo()
}
diff --git a/test/swift-files/indent/identifiers.swift
b/test/swift-files/indent/identifiers.swift
index 9c4afa0..db87d1a 100644
--- a/test/swift-files/indent/identifiers.swift
+++ b/test/swift-files/indent/identifiers.swift
@@ -109,6 +109,12 @@ func foo() {
foo(
some: 1
)
+ foo(
+ nonisolated: 1
+ )
+ foo(
+ isolated: 1
+ )
// Keywords used in statements
foo(