Skip to content

Commit 882b70a

Browse files
authored
Merge pull request #23 from GregoryBL/where-in
Where in
2 parents a106a51 + 7bcec36 commit 882b70a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Swift.sublime-syntax

+7-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ contexts:
226226
scope: keyword.control.flow.swift
227227
- match: (?<!\.)\b(?>while|repeat)\b
228228
scope: keyword.control.loop.swift
229-
- match: \b(?>do|catch)\b
229+
- match: \b(?>do|catch|throw|rethrow)\b
230230
scope: keyword.control.exception.swift
231231
- match: \b(try)(\?|!)?(?=\s)
232232
captures:
@@ -236,6 +236,12 @@ contexts:
236236
scope: keyword.control.import
237237
- match: \b(?:as(?:(\?|!)?)|is)(?=\s)
238238
scope: keyword.operator.cast.swift
239+
- match: \bwhere\b
240+
scope: keyword.control.where.swift
241+
- match: \bin\b
242+
scope: keyword.control.in.swift
243+
- match: \bguard\b
244+
scope: keyword.control.guard.swift
239245
- include: declaration-attributes
240246
- include: declaration-modifiers
241247
- include: type-attributes

syntax_test_swift.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,15 @@ private func myFunc(_ param: Contact, for p2: String) -> Bool { }
211211
do {
212212
try?
213213

214-
catch {
214+
catch RuntimeError where a == b{
215215
}
216216
}
217217

218+
{ response in
219+
guard a != b else throw RuntimeError
220+
call(response)
221+
}
222+
218223
extension String { }
219224

220225
MyClass.myVar?.myOtherVar.myFunction() as! NSString

0 commit comments

Comments
 (0)