Skip to content

Commit 3bdb92c

Browse files
authored
Merge pull request #14263 from gooichi/hotfix-improve-swift-mode
2 parents 2e23575 + 0199502 commit 3bdb92c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

utils/swift-mode.el

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
;; Decl and type keywords
5151
`(,(regexp-opt '("class" "init" "deinit" "extension" "fileprivate" "func"
5252
"import" "let" "protocol" "static" "struct" "subscript"
53-
"typealias" "enum" "var" "lazy" "where"
54-
"private" "public" "internal" "override" "throws" "rethrows"
55-
"open" "associatedtype" "inout" "indirect" "final")
53+
"typealias" "enum" "var" "lazy" "where" "private" "public"
54+
"internal" "override" "open" "associatedtype" "inout"
55+
"indirect" "final")
5656
'words) . font-lock-keyword-face)
5757
;; Variable decl keywords
5858
`("\\b\\(?:[^a-zA-Z_0-9]*\\)\\(get\\|set\\)\\(?:[^a-zA-Z_0-9]*\\)\\b" 1 font-lock-keyword-face)
@@ -68,16 +68,18 @@
6868
;; Statements
6969
`(,(regexp-opt '("if" "guard" "in" "else" "for" "do" "repeat" "while"
7070
"return" "break" "continue" "fallthrough" "switch" "case"
71-
"default" "throw" "defer" "try" "catch")
71+
"default" "defer" "catch")
7272
'words) . font-lock-keyword-face)
7373
;; Decl modifier keywords
7474
`(,(regexp-opt '("convenience" "dynamic" "mutating" "nonmutating" "optional"
7575
"required" "weak" "unowned" "safe" "unsafe")
7676
'words) . font-lock-keyword-face)
77+
;; Expression keywords: "Any" and "Self" are included in "Types" above
78+
`(,(regexp-opt '("as" "false" "is" "nil" "rethrows" "super" "self" "throw"
79+
"true" "try" "throws")
80+
'words) . font-lock-keyword-face)
7781
;; Expressions
7882
`(,(regexp-opt '("new") 'words) . font-lock-keyword-face)
79-
;; Special Variables
80-
'("self" . font-lock-keyword-face)
8183
;; Variables
8284
'("[a-zA-Z_][a-zA-Z_0-9]*" . font-lock-variable-name-face)
8385
;; Unnamed variables

0 commit comments

Comments
 (0)