PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.9.0
Code Block Pro – Beautiful Syntax Highlighting v1.9.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / swift.tmLanguage.json

swift.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.9.0, at build/shiki/languages/swift.tmLanguage.json

3,304 lines 129.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "information_for_contributors": [
3 "This file has been converted from https://github.com/textmate/swift.tmbundle/blob/master/Syntaxes/Swift.tmLanguage",
4 "If you want to provide a fix or improvement, please create a pull request against the original repository.",
5 "Once accepted there, we are happy to receive an update request."
6 ],
7 "version": "https://github.com/textmate/swift.tmbundle/commit/7a35637eb70aef3114b091c4ff6fbf6a2faa881b",
8 "name": "swift",
9 "scopeName": "source.swift",
10 "comment": "See swift.tmbundle/grammar-test.swift for test cases.",
11 "patterns": [
12 {
13 "include": "#root"
14 }
15 ],
16 "repository": {
17 "async-throws": {
18 "captures": {
19 "1": {
20 "name": "invalid.illegal.await-must-precede-throws.swift"
21 },
22 "2": {
23 "name": "keyword.control.exception.swift"
24 },
25 "3": {
26 "name": "keyword.control.async.swift"
27 }
28 },
29 "match": "\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b"
30 },
31 "attributes": {
32 "patterns": [
33 {
34 "begin": "((@)available)(\\()",
35 "beginCaptures": {
36 "1": {
37 "name": "storage.modifier.attribute.swift"
38 },
39 "2": {
40 "name": "punctuation.definition.attribute.swift"
41 },
42 "3": {
43 "name": "punctuation.definition.arguments.begin.swift"
44 }
45 },
46 "end": "\\)",
47 "endCaptures": {
48 "0": {
49 "name": "punctuation.definition.arguments.end.swift"
50 }
51 },
52 "name": "meta.attribute.available.swift",
53 "patterns": [
54 {
55 "captures": {
56 "1": {
57 "name": "keyword.other.platform.os.swift"
58 },
59 "2": {
60 "name": "constant.numeric.swift"
61 }
62 },
63 "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?"
64 },
65 {
66 "begin": "\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*",
67 "beginCaptures": {
68 "1": {
69 "name": "keyword.other.swift"
70 },
71 "2": {
72 "name": "punctuation.separator.key-value.swift"
73 }
74 },
75 "end": "(?!\\G)",
76 "patterns": [
77 {
78 "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b",
79 "name": "constant.numeric.swift"
80 }
81 ]
82 },
83 {
84 "begin": "\\b(message|renamed)\\s*(:)\\s*(?=\")",
85 "beginCaptures": {
86 "1": {
87 "name": "keyword.other.swift"
88 },
89 "2": {
90 "name": "punctuation.separator.key-value.swift"
91 }
92 },
93 "end": "(?!\\G)",
94 "patterns": [
95 {
96 "include": "#literals"
97 }
98 ]
99 },
100 {
101 "captures": {
102 "1": {
103 "name": "keyword.other.platform.all.swift"
104 },
105 "2": {
106 "name": "keyword.other.swift"
107 },
108 "3": {
109 "name": "invalid.illegal.character-not-allowed-here.swift"
110 }
111 },
112 "match": "(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])"
113 }
114 ]
115 },
116 {
117 "begin": "((@)objc)(\\()",
118 "beginCaptures": {
119 "1": {
120 "name": "storage.modifier.attribute.swift"
121 },
122 "2": {
123 "name": "punctuation.definition.attribute.swift"
124 },
125 "3": {
126 "name": "punctuation.definition.arguments.begin.swift"
127 }
128 },
129 "end": "\\)",
130 "endCaptures": {
131 "0": {
132 "name": "punctuation.definition.arguments.end.swift"
133 }
134 },
135 "name": "meta.attribute.objc.swift",
136 "patterns": [
137 {
138 "captures": {
139 "1": {
140 "name": "invalid.illegal.missing-colon-after-selector-piece.swift"
141 }
142 },
143 "match": "\\w*(?::(?:\\w*:)*(\\w*))?",
144 "name": "entity.name.function.swift"
145 }
146 ]
147 },
148 {
149 "begin": "(@)(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)",
150 "beginCaptures": {
151 "0": {
152 "name": "storage.modifier.attribute.swift"
153 },
154 "1": {
155 "name": "punctuation.definition.attribute.swift"
156 },
157 "2": {
158 "name": "punctuation.definition.identifier.swift"
159 },
160 "3": {
161 "name": "punctuation.definition.identifier.swift"
162 }
163 },
164 "comment": "any other attribute",
165 "end": "(?!\\G\\()",
166 "name": "meta.attribute.swift",
167 "patterns": [
168 {
169 "begin": "\\(",
170 "beginCaptures": {
171 "0": {
172 "name": "punctuation.definition.arguments.begin.swift"
173 }
174 },
175 "end": "\\)",
176 "endCaptures": {
177 "0": {
178 "name": "punctuation.definition.arguments.end.swift"
179 }
180 },
181 "name": "meta.arguments.attribute.swift",
182 "patterns": [
183 {
184 "include": "#expressions"
185 }
186 ]
187 }
188 ]
189 }
190 ]
191 },
192 "builtin-functions": {
193 "patterns": [
194 {
195 "comment": "Member functions in the standard library in Swift 3 which may be used with trailing closures and no parentheses",
196 "match": "(?<=\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a(?:p|x)))(?=\\s*[({])\\b",
197 "name": "support.function.swift"
198 },
199 {
200 "comment": "Member functions in the standard library in Swift 3",
201 "match": "(?<=\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:Reference|OrPinnedReference)|as(?:Suffix|Prefix))|ne(?:gate(?:d)?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:RetainedValue|UnretainedValue)|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:Retained|Unretained)|re(?:decessor|fix))|e(?:scape(?:d)?|n(?:code|umerate(?:d)?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:BackwardFrom|From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:Range|Subrange)?|verse(?:d)?|quest(?:NativeBuffer|UniqueMutableBackingBuffer)|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\s*\\()",
202 "name": "support.function.swift"
203 },
204 {
205 "comment": "Member functions in the standard library in Swift 2 only",
206 "match": "(?<=\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\s*\\()",
207 "name": "support.function.swift"
208 }
209 ]
210 },
211 "builtin-global-functions": {
212 "patterns": [
213 {
214 "begin": "\\b(type)(\\()\\s*(of)(:)",
215 "beginCaptures": {
216 "1": {
217 "name": "support.function.dynamic-type.swift"
218 },
219 "2": {
220 "name": "punctuation.definition.arguments.begin.swift"
221 },
222 "3": {
223 "name": "support.variable.parameter.swift"
224 },
225 "4": {
226 "name": "punctuation.separator.argument-label.begin.swift"
227 }
228 },
229 "end": "\\)",
230 "endCaptures": {
231 "0": {
232 "name": "punctuation.definition.arguments.end.swift"
233 }
234 },
235 "patterns": [
236 {
237 "include": "#expressions"
238 }
239 ]
240 },
241 {
242 "comment": "Global functions available in Swift 3 which may be used with trailing closures and no parentheses",
243 "match": "\\b(?:anyGenerator|autoreleasepool)(?=\\s*[({])\\b",
244 "name": "support.function.swift"
245 },
246 {
247 "comment": "Global functions available in Swift 3",
248 "match": "\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:MutablePointer|Pointer)|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\s*\\()",
249 "name": "support.function.swift"
250 },
251 {
252 "comment": "Global functions available in Swift 2 only",
253 "match": "\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:MutablePointers|Pointers)|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\s*\\()",
254 "name": "support.function.swift"
255 }
256 ]
257 },
258 "builtin-properties": {
259 "patterns": [
260 {
261 "comment": "The simpler (?<=\\bProcess\\.|\\bCommandLine\\.) breaks VS Code / Atom, see https://github.com/textmate/swift.tmbundle/issues/29",
262 "match": "(?<=^Process\\.|\\WProcess\\.|^CommandLine\\.|\\WCommandLine\\.)(arguments|argc|unsafeArgv)",
263 "name": "support.variable.swift"
264 },
265 {
266 "comment": "Properties in the standard library in Swift 3",
267 "match": "(?<=\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:scription|bugDescription)|u(?:n(?:safelyUnwrapped|icodeScalar(?:s)?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|value(?:s)?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzeroMagnitude|rmalMagnitude)|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\b",
268 "name": "support.variable.swift"
269 },
270 {
271 "comment": "Properties in the standard library in Swift 2 only",
272 "match": "(?<=\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\b",
273 "name": "support.variable.swift"
274 },
275 {
276 "comment": "Enum cases in the standard library - note that there is some overlap between these and the properties",
277 "match": "(?<=\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\b",
278 "name": "support.variable.swift"
279 }
280 ]
281 },
282 "builtin-types": {
283 "comment": "Types provided in the standard library",
284 "patterns": [
285 {
286 "include": "#builtin-class-type"
287 },
288 {
289 "include": "#builtin-enum-type"
290 },
291 {
292 "include": "#builtin-protocol-type"
293 },
294 {
295 "include": "#builtin-struct-type"
296 },
297 {
298 "include": "#builtin-typealias"
299 },
300 {
301 "match": "\\bAny\\b",
302 "name": "support.type.any.swift"
303 }
304 ],
305 "repository": {
306 "builtin-class-type": {
307 "comment": "Builtin class types",
308 "match": "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b",
309 "name": "support.class.swift"
310 },
311 "builtin-enum-type": {
312 "patterns": [
313 {
314 "comment": "CommandLine is an enum, but it acts like a constant",
315 "match": "\\b(?:CommandLine|Process(?=\\.))\\b",
316 "name": "support.constant.swift"
317 },
318 {
319 "comment": "The return type of a function that never returns",
320 "match": "\\bNever\\b",
321 "name": "support.constant.never.swift"
322 },
323 {
324 "comment": "Enum types in the standard library in Swift 3",
325 "match": "\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\b",
326 "name": "support.type.swift"
327 },
328 {
329 "comment": "Enum types in the standard library in Swift 2 only",
330 "match": "\\b(?:MirrorDisposition|QuickLookObject)\\b",
331 "name": "support.type.swift"
332 }
333 ]
334 },
335 "builtin-protocol-type": {
336 "patterns": [
337 {
338 "comment": "Protocols in the standard library in Swift 3",
339 "match": "\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ideable|eamable)|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:SequenceProtocol|CollectionProtocol))|A(?:nyObject|bsoluteValuable))\\b",
340 "name": "support.type.swift"
341 },
342 {
343 "comment": "Protocols in the standard library in Swift 2 only",
344 "match": "\\b(?:Ran(?:domAccessIndexType|geReplaceableCollectionType)|GeneratorType|M(?:irror(?:Type|PathType)|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperationsType|directionalIndexType)|oolean(?:Type|LiteralConvertible))|S(?:tring(?:InterpolationConvertible|LiteralConvertible)|i(?:nkType|gned(?:NumberType|IntegerType))|e(?:tAlgebraType|quenceType)|liceable)|NilLiteralConvertible|C(?:ollectionType|VarArgType)|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\b",
345 "name": "support.type.swift"
346 }
347 ]
348 },
349 "builtin-struct-type": {
350 "patterns": [
351 {
352 "comment": "Structs in the standard library in Swift 3",
353 "match": "\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccessSlice|BidirectionalSlice|Slice)|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccessSlice|geReplaceable(?:RandomAccessSlice|BidirectionalSlice|Slice))|BidirectionalSlice|Slice)|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:Generator|Iterator)?|o(?:Generator|Iterator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:Range|ClosedRange)|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Generator|Iterator))?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccessIndices|BidirectionalIndices|Indices))|U(?:n(?:safe(?:RawPointer|Mutable(?:RawPointer|BufferPointer|Pointer)|BufferPointer(?:Generator|Iterator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\b",
354 "name": "support.type.swift"
355 },
356 {
357 "comment": "Structs in the standard library in Swift 2 only",
358 "match": "\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\b",
359 "name": "support.type.swift"
360 }
361 ]
362 },
363 "builtin-typealias": {
364 "patterns": [
365 {
366 "comment": "Typealiases in the standard library in Swift 3",
367 "match": "\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam(?:1|2)))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lement(?:s)?|x(?:tendedGraphemeCluster(?:Type|LiteralType)|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\b",
368 "name": "support.type.swift"
369 },
370 {
371 "comment": "Typealiases in the standard library in Swift 2 only",
372 "match": "\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\b",
373 "name": "support.type.swift"
374 }
375 ]
376 }
377 }
378 },
379 "code-block": {
380 "begin": "\\{",
381 "beginCaptures": {
382 "0": {
383 "name": "punctuation.section.scope.begin.swift"
384 }
385 },
386 "end": "\\}",
387 "endCaptures": {
388 "0": {
389 "name": "punctuation.section.scope.end.swift"
390 }
391 },
392 "patterns": [
393 {
394 "include": "$self"
395 }
396 ]
397 },
398 "comments": {
399 "patterns": [
400 {
401 "captures": {
402 "1": {
403 "name": "punctuation.definition.comment.swift"
404 }
405 },
406 "match": "\\A^(#!).*$\\n?",
407 "name": "comment.line.number-sign.swift"
408 },
409 {
410 "begin": "/\\*\\*(?!/)",
411 "beginCaptures": {
412 "0": {
413 "name": "punctuation.definition.comment.begin.swift"
414 }
415 },
416 "end": "\\*/",
417 "endCaptures": {
418 "0": {
419 "name": "punctuation.definition.comment.end.swift"
420 }
421 },
422 "name": "comment.block.documentation.swift",
423 "patterns": [
424 {
425 "include": "#nested"
426 }
427 ]
428 },
429 {
430 "begin": "/\\*:",
431 "beginCaptures": {
432 "0": {
433 "name": "punctuation.definition.comment.begin.swift"
434 }
435 },
436 "end": "\\*/",
437 "endCaptures": {
438 "0": {
439 "name": "punctuation.definition.comment.end.swift"
440 }
441 },
442 "name": "comment.block.documentation.playground.swift",
443 "patterns": [
444 {
445 "include": "#nested"
446 }
447 ]
448 },
449 {
450 "begin": "/\\*",
451 "beginCaptures": {
452 "0": {
453 "name": "punctuation.definition.comment.begin.swift"
454 }
455 },
456 "end": "\\*/",
457 "endCaptures": {
458 "0": {
459 "name": "punctuation.definition.comment.end.swift"
460 }
461 },
462 "name": "comment.block.swift",
463 "patterns": [
464 {
465 "include": "#nested"
466 }
467 ]
468 },
469 {
470 "match": "\\*/",
471 "name": "invalid.illegal.unexpected-end-of-block-comment.swift"
472 },
473 {
474 "begin": "(^[ \\t]+)?(?=//)",
475 "beginCaptures": {
476 "1": {
477 "name": "punctuation.whitespace.comment.leading.swift"
478 }
479 },
480 "end": "(?!\\G)",
481 "patterns": [
482 {
483 "begin": "///",
484 "beginCaptures": {
485 "0": {
486 "name": "punctuation.definition.comment.swift"
487 }
488 },
489 "end": "^",
490 "name": "comment.line.triple-slash.documentation.swift"
491 },
492 {
493 "begin": "//:",
494 "beginCaptures": {
495 "0": {
496 "name": "punctuation.definition.comment.swift"
497 }
498 },
499 "end": "^",
500 "name": "comment.line.double-slash.documentation.swift"
501 },
502 {
503 "begin": "//",
504 "beginCaptures": {
505 "0": {
506 "name": "punctuation.definition.comment.swift"
507 }
508 },
509 "end": "^",
510 "name": "comment.line.double-slash.swift"
511 }
512 ]
513 }
514 ],
515 "repository": {
516 "nested": {
517 "begin": "/\\*",
518 "end": "\\*/",
519 "patterns": [
520 {
521 "include": "#nested"
522 }
523 ]
524 }
525 }
526 },
527 "compiler-control": {
528 "patterns": [
529 {
530 "begin": "^\\s*(#)(if|elseif)\\s+(false)\\b.*?(?=$|//|/\\*)",
531 "beginCaptures": {
532 "0": {
533 "name": "meta.preprocessor.conditional.swift"
534 },
535 "1": {
536 "name": "punctuation.definition.preprocessor.swift"
537 },
538 "2": {
539 "name": "keyword.control.preprocessor.conditional.swift"
540 },
541 "3": {
542 "name": "constant.language.boolean.swift"
543 }
544 },
545 "contentName": "comment.block.preprocessor.swift",
546 "end": "(?=^\\s*(#(elseif|else|endif)\\b))"
547 },
548 {
549 "begin": "^\\s*(#)(if|elseif)\\s+",
550 "captures": {
551 "1": {
552 "name": "punctuation.definition.preprocessor.swift"
553 },
554 "2": {
555 "name": "keyword.control.preprocessor.conditional.swift"
556 }
557 },
558 "end": "(?=\\s*(?://|/\\*))|$",
559 "name": "meta.preprocessor.conditional.swift",
560 "patterns": [
561 {
562 "match": "(&&|\\|\\|)",
563 "name": "keyword.operator.logical.swift"
564 },
565 {
566 "match": "\\b(true|false)\\b",
567 "name": "constant.language.boolean.swift"
568 },
569 {
570 "captures": {
571 "1": {
572 "name": "keyword.other.condition.swift"
573 },
574 "2": {
575 "name": "punctuation.definition.parameters.begin.swift"
576 },
577 "3": {
578 "name": "support.constant.platform.architecture.swift"
579 },
580 "4": {
581 "name": "punctuation.definition.parameters.end.swift"
582 }
583 },
584 "match": "\\b(arch)\\s*(\\()\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\w+)\\s*(\\))"
585 },
586 {
587 "captures": {
588 "1": {
589 "name": "keyword.other.condition.swift"
590 },
591 "2": {
592 "name": "punctuation.definition.parameters.begin.swift"
593 },
594 "3": {
595 "name": "support.constant.platform.os.swift"
596 },
597 "4": {
598 "name": "punctuation.definition.parameters.end.swift"
599 }
600 },
601 "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))"
602 },
603 {
604 "captures": {
605 "1": {
606 "name": "keyword.other.condition.swift"
607 },
608 "2": {
609 "name": "punctuation.definition.parameters.begin.swift"
610 },
611 "3": {
612 "name": "entity.name.type.module.swift"
613 },
614 "4": {
615 "name": "punctuation.definition.parameters.end.swift"
616 }
617 },
618 "match": "\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))"
619 },
620 {
621 "begin": "\\b(targetEnvironment)\\s*(\\()",
622 "beginCaptures": {
623 "1": {
624 "name": "keyword.other.condition.swift"
625 },
626 "2": {
627 "name": "punctuation.definition.parameters.begin.swift"
628 }
629 },
630 "end": "(\\))|$",
631 "endCaptures": {
632 "1": {
633 "name": "punctuation.definition.parameters.end.swift"
634 }
635 },
636 "patterns": [
637 {
638 "match": "\\b(simulator|UIKitForMac)\\b",
639 "name": "support.constant.platform.environment.swift"
640 }
641 ]
642 },
643 {
644 "begin": "\\b(swift|compiler)\\s*(\\()",
645 "beginCaptures": {
646 "1": {
647 "name": "keyword.other.condition.swift"
648 },
649 "2": {
650 "name": "punctuation.definition.parameters.begin.swift"
651 }
652 },
653 "end": "(\\))|$",
654 "endCaptures": {
655 "1": {
656 "name": "punctuation.definition.parameters.end.swift"
657 }
658 },
659 "patterns": [
660 {
661 "match": ">=|<",
662 "name": "keyword.operator.comparison.swift"
663 },
664 {
665 "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b",
666 "name": "constant.numeric.swift"
667 }
668 ]
669 }
670 ]
671 },
672 {
673 "captures": {
674 "1": {
675 "name": "punctuation.definition.preprocessor.swift"
676 },
677 "2": {
678 "name": "keyword.control.preprocessor.conditional.swift"
679 },
680 "3": {
681 "patterns": [
682 {
683 "match": "\\S+",
684 "name": "invalid.illegal.character-not-allowed-here.swift"
685 }
686 ]
687 }
688 },
689 "match": "^\\s*(#)(else|endif)(.*?)(?=$|//|/\\*)",
690 "name": "meta.preprocessor.conditional.swift"
691 },
692 {
693 "captures": {
694 "1": {
695 "name": "punctuation.definition.preprocessor.swift"
696 },
697 "2": {
698 "name": "keyword.control.preprocessor.sourcelocation.swift"
699 },
700 "4": {
701 "name": "punctuation.definition.parameters.begin.swift"
702 },
703 "5": {
704 "patterns": [
705 {
706 "begin": "(file)\\s*(:)\\s*(?=\")",
707 "beginCaptures": {
708 "1": {
709 "name": "support.variable.parameter.swift"
710 },
711 "2": {
712 "name": "punctuation.separator.key-value.swift"
713 }
714 },
715 "end": "(?!\\G)",
716 "patterns": [
717 {
718 "include": "#literals"
719 }
720 ]
721 },
722 {
723 "captures": {
724 "1": {
725 "name": "support.variable.parameter.swift"
726 },
727 "2": {
728 "name": "punctuation.separator.key-value.swift"
729 },
730 "3": {
731 "name": "constant.numeric.integer.swift"
732 }
733 },
734 "match": "(line)\\s*(:)\\s*([0-9]+)"
735 },
736 {
737 "match": ",",
738 "name": "punctuation.separator.parameters.swift"
739 },
740 {
741 "match": "\\S+",
742 "name": "invalid.illegal.character-not-allowed-here.swift"
743 }
744 ]
745 },
746 "6": {
747 "name": "punctuation.definition.parameters.begin.swift"
748 },
749 "7": {
750 "patterns": [
751 {
752 "match": "\\S+",
753 "name": "invalid.illegal.character-not-allowed-here.swift"
754 }
755 ]
756 }
757 },
758 "match": "^\\s*(#)(sourceLocation)((\\()([^)]*)(\\)))(.*?)(?=$|//|/\\*)",
759 "name": "meta.preprocessor.sourcelocation.swift"
760 }
761 ]
762 },
763 "declarations": {
764 "patterns": [
765 {
766 "include": "#function"
767 },
768 {
769 "include": "#function-initializer"
770 },
771 {
772 "include": "#typed-variable-declaration"
773 },
774 {
775 "include": "#import"
776 },
777 {
778 "include": "#operator"
779 },
780 {
781 "include": "#precedencegroup"
782 },
783 {
784 "include": "#protocol"
785 },
786 {
787 "include": "#type"
788 },
789 {
790 "include": "#extension"
791 },
792 {
793 "include": "#typealias"
794 }
795 ],
796 "repository": {
797 "available-types": {
798 "patterns": [
799 {
800 "include": "#comments"
801 },
802 {
803 "include": "#builtin-types"
804 },
805 {
806 "include": "#attributes"
807 },
808 {
809 "match": "\\basync\\b",
810 "name": "keyword.control.async.swift"
811 },
812 {
813 "match": "\\b(?:throws|rethrows)\\b",
814 "name": "keyword.control.exception.swift"
815 },
816 {
817 "match": "\\bsome\\b",
818 "name": "keyword.operator.type.opaque.swift"
819 },
820 {
821 "match": "\\bany\\b",
822 "name": "keyword.operator.type.existential.swift"
823 },
824 {
825 "match": "\\b(?:inout|isolated)\\b",
826 "name": "storage.modifier.swift"
827 },
828 {
829 "match": "\\bSelf\\b",
830 "name": "variable.language.swift"
831 },
832 {
833 "captures": {
834 "1": {
835 "name": "keyword.operator.type.function.swift"
836 }
837 },
838 "match": "(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])"
839 },
840 {
841 "captures": {
842 "1": {
843 "name": "keyword.operator.type.composition.swift"
844 }
845 },
846 "comment": "Swift 3: A & B",
847 "match": "(?<![/=\\-+!*%<>&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])"
848 },
849 {
850 "match": "[?!]",
851 "name": "keyword.operator.type.optional.swift"
852 },
853 {
854 "match": "\\.\\.\\.",
855 "name": "keyword.operator.function.variadic-parameter.swift"
856 },
857 {
858 "comment": "Swift 2: protocol<A, B>",
859 "match": "\\bprotocol\\b",
860 "name": "keyword.operator.type.composition.swift"
861 },
862 {
863 "match": "(?<=\\.)(?:Protocol|Type)\\b",
864 "name": "keyword.operator.type.metatype.swift"
865 },
866 {
867 "include": "#tuple-type"
868 },
869 {
870 "include": "#collection-type"
871 },
872 {
873 "include": "#generic-argument-clause"
874 }
875 ],
876 "repository": {
877 "collection-type": {
878 "begin": "\\[",
879 "beginCaptures": {
880 "0": {
881 "name": "punctuation.section.collection-type.begin.swift"
882 }
883 },
884 "comment": "array and dictionary types [Value] and [Key: Value]",
885 "end": "\\]|(?=[>){}])",
886 "endCaptures": {
887 "0": {
888 "name": "punctuation.section.collection-type.end.swift"
889 }
890 },
891 "patterns": [
892 {
893 "include": "#available-types"
894 },
895 {
896 "begin": ":",
897 "beginCaptures": {
898 "0": {
899 "name": "punctuation.separator.key-value.swift"
900 }
901 },
902 "end": "(?=\\]|[>){}])",
903 "patterns": [
904 {
905 "match": ":",
906 "name": "invalid.illegal.extra-colon-in-dictionary-type.swift"
907 },
908 {
909 "include": "#available-types"
910 }
911 ]
912 }
913 ]
914 },
915 "tuple-type": {
916 "begin": "\\(",
917 "beginCaptures": {
918 "0": {
919 "name": "punctuation.section.tuple-type.begin.swift"
920 }
921 },
922 "end": "\\)|(?=[>\\]{}])",
923 "endCaptures": {
924 "0": {
925 "name": "punctuation.section.tuple-type.end.swift"
926 }
927 },
928 "patterns": [
929 {
930 "include": "#available-types"
931 }
932 ]
933 }
934 }
935 },
936 "extension": {
937 "begin": "\\b(extension)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
938 "beginCaptures": {
939 "1": {
940 "name": "storage.type.$1.swift"
941 },
942 "2": {
943 "name": "entity.name.type.swift",
944 "patterns": [
945 {
946 "include": "#available-types"
947 }
948 ]
949 },
950 "3": {
951 "name": "punctuation.definition.identifier.swift"
952 },
953 "4": {
954 "name": "punctuation.definition.identifier.swift"
955 }
956 },
957 "end": "(?<=\\})",
958 "name": "meta.definition.type.$1.swift",
959 "patterns": [
960 {
961 "include": "#comments"
962 },
963 {
964 "comment": "SE-0143: Conditional Conformances",
965 "include": "#generic-where-clause"
966 },
967 {
968 "include": "#inheritance-clause"
969 },
970 {
971 "begin": "\\{",
972 "beginCaptures": {
973 "0": {
974 "name": "punctuation.definition.type.begin.swift"
975 }
976 },
977 "end": "\\}",
978 "endCaptures": {
979 "0": {
980 "name": "punctuation.definition.type.end.swift"
981 }
982 },
983 "name": "meta.definition.type.body.swift",
984 "patterns": [
985 {
986 "include": "$self"
987 }
988 ]
989 }
990 ]
991 },
992 "function": {
993 "begin": "(?x)\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(?:(nonisolated)\\s+)?\n\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t\t\t\t\t | (?:\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t",
994 "beginCaptures": {
995 "1": {
996 "name": "storage.modifier.swift"
997 },
998 "2": {
999 "name": "storage.type.function.swift"
1000 },
1001 "3": {
1002 "name": "entity.name.function.swift"
1003 },
1004 "4": {
1005 "name": "punctuation.definition.identifier.swift"
1006 },
1007 "5": {
1008 "name": "punctuation.definition.identifier.swift"
1009 }
1010 },
1011 "end": "(?<=\\})|$(?# functions in protocol declarations or generated interfaces have no body)",
1012 "name": "meta.definition.function.swift",
1013 "patterns": [
1014 {
1015 "include": "#comments"
1016 },
1017 {
1018 "include": "#generic-parameter-clause"
1019 },
1020 {
1021 "include": "#parameter-clause"
1022 },
1023 {
1024 "include": "#function-result"
1025 },
1026 {
1027 "include": "#async-throws"
1028 },
1029 {
1030 "comment": "Swift 3: generic constraints after the parameters and return type",
1031 "include": "#generic-where-clause"
1032 },
1033 {
1034 "begin": "(\\{)",
1035 "beginCaptures": {
1036 "1": {
1037 "name": "punctuation.section.function.begin.swift"
1038 }
1039 },
1040 "end": "(\\})",
1041 "endCaptures": {
1042 "1": {
1043 "name": "punctuation.section.function.end.swift"
1044 }
1045 },
1046 "name": "meta.definition.function.body.swift",
1047 "patterns": [
1048 {
1049 "include": "$self"
1050 }
1051 ]
1052 }
1053 ]
1054 },
1055 "function-initializer": {
1056 "begin": "(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)",
1057 "beginCaptures": {
1058 "1": {
1059 "name": "storage.type.function.swift",
1060 "patterns": [
1061 {
1062 "match": "(?<=[?!])[?!]+",
1063 "name": "invalid.illegal.character-not-allowed-here.swift"
1064 }
1065 ]
1066 }
1067 },
1068 "end": "(?<=\\})|$",
1069 "name": "meta.definition.function.initializer.swift",
1070 "patterns": [
1071 {
1072 "include": "#comments"
1073 },
1074 {
1075 "include": "#generic-parameter-clause"
1076 },
1077 {
1078 "include": "#parameter-clause"
1079 },
1080 {
1081 "include": "#async-throws"
1082 },
1083 {
1084 "comment": "Swift 3: generic constraints after the parameters and return type",
1085 "include": "#generic-where-clause"
1086 },
1087 {
1088 "begin": "(\\{)",
1089 "beginCaptures": {
1090 "1": {
1091 "name": "punctuation.section.function.begin.swift"
1092 }
1093 },
1094 "end": "(\\})",
1095 "endCaptures": {
1096 "1": {
1097 "name": "punctuation.section.function.end.swift"
1098 }
1099 },
1100 "name": "meta.definition.function.body.swift",
1101 "patterns": [
1102 {
1103 "include": "$self"
1104 }
1105 ]
1106 }
1107 ]
1108 },
1109 "function-result": {
1110 "begin": "(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])\\s*",
1111 "beginCaptures": {
1112 "1": {
1113 "name": "keyword.operator.function-result.swift"
1114 }
1115 },
1116 "end": "(?!\\G)(?=\\{|\\bwhere\\b|;)|$",
1117 "name": "meta.function-result.swift",
1118 "patterns": [
1119 {
1120 "include": "#available-types"
1121 }
1122 ]
1123 },
1124 "generic-argument-clause": {
1125 "begin": "<",
1126 "beginCaptures": {
1127 "0": {
1128 "name": "punctuation.separator.generic-argument-clause.begin.swift"
1129 }
1130 },
1131 "end": ">|(?=[)\\]{}])",
1132 "endCaptures": {
1133 "0": {
1134 "name": "punctuation.separator.generic-argument-clause.end.swift"
1135 }
1136 },
1137 "name": "meta.generic-argument-clause.swift",
1138 "patterns": [
1139 {
1140 "include": "#available-types"
1141 }
1142 ]
1143 },
1144 "generic-parameter-clause": {
1145 "begin": "<",
1146 "beginCaptures": {
1147 "0": {
1148 "name": "punctuation.separator.generic-parameter-clause.begin.swift"
1149 }
1150 },
1151 "end": ">|(?=[^\\w\\d:<>\\s,=&`])(?# characters besides these are never valid in a generic param list -- even if it's not really a valid clause, we should stop trying to parse it if we see one of them.)",
1152 "endCaptures": {
1153 "0": {
1154 "name": "punctuation.separator.generic-parameter-clause.end.swift"
1155 }
1156 },
1157 "name": "meta.generic-parameter-clause.swift",
1158 "patterns": [
1159 {
1160 "include": "#comments"
1161 },
1162 {
1163 "comment": "Swift 2: constraints inside the generic param list",
1164 "include": "#generic-where-clause"
1165 },
1166 {
1167 "captures": {
1168 "1": {
1169 "name": "variable.language.generic-parameter.swift"
1170 }
1171 },
1172 "match": "\\b((?!\\d)\\w[\\w\\d]*)\\b"
1173 },
1174 {
1175 "match": ",",
1176 "name": "punctuation.separator.generic-parameters.swift"
1177 },
1178 {
1179 "begin": "(:)\\s*",
1180 "beginCaptures": {
1181 "1": {
1182 "name": "punctuation.separator.generic-parameter-constraint.swift"
1183 }
1184 },
1185 "end": "(?=[,>]|(?!\\G)\\bwhere\\b)",
1186 "name": "meta.generic-parameter-constraint.swift",
1187 "patterns": [
1188 {
1189 "begin": "\\G",
1190 "end": "(?=[,>]|(?!\\G)\\bwhere\\b)",
1191 "name": "entity.other.inherited-class.swift",
1192 "patterns": [
1193 {
1194 "include": "#type-identifier"
1195 }
1196 ]
1197 }
1198 ]
1199 }
1200 ]
1201 },
1202 "generic-where-clause": {
1203 "begin": "\\b(where)\\b\\s*",
1204 "beginCaptures": {
1205 "1": {
1206 "name": "keyword.other.generic-constraint-introducer.swift"
1207 }
1208 },
1209 "end": "(?!\\G)$|(?=[>{};\\n]|//|/\\*)",
1210 "name": "meta.generic-where-clause.swift",
1211 "patterns": [
1212 {
1213 "include": "#comments"
1214 },
1215 {
1216 "include": "#requirement-list"
1217 }
1218 ],
1219 "repository": {
1220 "requirement-list": {
1221 "begin": "\\G|,\\s*",
1222 "end": "(?=[,>{};\\n]|//|/\\*)",
1223 "patterns": [
1224 {
1225 "include": "#comments"
1226 },
1227 {
1228 "include": "#constraint"
1229 },
1230 {
1231 "include": "#available-types"
1232 },
1233 {
1234 "begin": "(?<![/=\\-+!*%<>&|\\^~.])(==)(?![/=\\-+!*%<>&|\\^~.])",
1235 "beginCaptures": {
1236 "1": {
1237 "name": "keyword.operator.generic-constraint.same-type.swift"
1238 }
1239 },
1240 "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1241 "name": "meta.generic-where-clause.same-type-requirement.swift",
1242 "patterns": [
1243 {
1244 "include": "#available-types"
1245 }
1246 ]
1247 },
1248 {
1249 "begin": "(?<![/=\\-+!*%<>&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])",
1250 "beginCaptures": {
1251 "1": {
1252 "name": "keyword.operator.generic-constraint.conforms-to.swift"
1253 }
1254 },
1255 "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1256 "name": "meta.generic-where-clause.conformance-requirement.swift",
1257 "patterns": [
1258 {
1259 "begin": "\\G\\s*",
1260 "contentName": "entity.other.inherited-class.swift",
1261 "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1262 "patterns": [
1263 {
1264 "include": "#available-types"
1265 }
1266 ]
1267 }
1268 ]
1269 }
1270 ]
1271 }
1272 }
1273 },
1274 "import": {
1275 "begin": "(?<!\\.)\\b(import)\\s+",
1276 "beginCaptures": {
1277 "1": {
1278 "name": "keyword.control.import.swift"
1279 }
1280 },
1281 "end": "(;)|$\\n?|(?=//|/\\*)",
1282 "endCaptures": {
1283 "1": {
1284 "name": "punctuation.terminator.statement.swift"
1285 }
1286 },
1287 "name": "meta.import.swift",
1288 "patterns": [
1289 {
1290 "begin": "\\G(?!;|$|//|/\\*)(?:(typealias|struct|class|actor|enum|protocol|var|func)\\s+)?",
1291 "beginCaptures": {
1292 "1": {
1293 "name": "storage.modifier.swift"
1294 }
1295 },
1296 "end": "(?=;|$|//|/\\*)",
1297 "patterns": [
1298 {
1299 "captures": {
1300 "1": {
1301 "name": "punctuation.definition.identifier.swift"
1302 },
1303 "2": {
1304 "name": "punctuation.definition.identifier.swift"
1305 }
1306 },
1307 "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t\t\t\t\t\t\t\t",
1308 "name": "entity.name.type.swift"
1309 },
1310 {
1311 "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t\\$[0-9]+\n\t\t\t\t\t\t\t\t\t",
1312 "name": "entity.name.type.swift"
1313 },
1314 {
1315 "captures": {
1316 "1": {
1317 "patterns": [
1318 {
1319 "match": "\\.",
1320 "name": "invalid.illegal.dot-not-allowed-here.swift"
1321 }
1322 ]
1323 }
1324 },
1325 "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t(?=\\.|;|$|//|/\\*|\\s)\n\t\t\t\t\t\t\t\t\t",
1326 "name": "entity.name.type.swift"
1327 },
1328 {
1329 "match": "\\.",
1330 "name": "punctuation.separator.import.swift"
1331 },
1332 {
1333 "begin": "(?!\\s*(;|$|//|/\\*))",
1334 "end": "(?=\\s*(;|$|//|/\\*))",
1335 "name": "invalid.illegal.character-not-allowed-here.swift"
1336 }
1337 ]
1338 }
1339 ]
1340 },
1341 "inheritance-clause": {
1342 "begin": "(:)(?=\\s*\\{)|(:)\\s*",
1343 "beginCaptures": {
1344 "1": {
1345 "name": "invalid.illegal.empty-inheritance-clause.swift"
1346 },
1347 "2": {
1348 "name": "punctuation.separator.inheritance-clause.swift"
1349 }
1350 },
1351 "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1352 "name": "meta.inheritance-clause.swift",
1353 "patterns": [
1354 {
1355 "begin": "\\bclass\\b",
1356 "beginCaptures": {
1357 "0": {
1358 "name": "storage.type.class.swift"
1359 }
1360 },
1361 "end": "(?=[={}]|(?!\\G)\\bwhere\\b)",
1362 "patterns": [
1363 {
1364 "include": "#comments"
1365 },
1366 {
1367 "include": "#more-types"
1368 }
1369 ]
1370 },
1371 {
1372 "begin": "\\G",
1373 "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1374 "patterns": [
1375 {
1376 "include": "#comments"
1377 },
1378 {
1379 "include": "#inherited-type"
1380 },
1381 {
1382 "include": "#more-types"
1383 }
1384 ]
1385 }
1386 ],
1387 "repository": {
1388 "inherited-type": {
1389 "begin": "(?=[`\\p{L}_])",
1390 "end": "(?!\\G)",
1391 "name": "entity.other.inherited-class.swift",
1392 "patterns": [
1393 {
1394 "include": "#type-identifier"
1395 }
1396 ]
1397 },
1398 "more-types": {
1399 "begin": ",\\s*",
1400 "end": "(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)",
1401 "name": "meta.inheritance-list.more-types",
1402 "patterns": [
1403 {
1404 "include": "#comments"
1405 },
1406 {
1407 "include": "#inherited-type"
1408 },
1409 {
1410 "include": "#more-types"
1411 }
1412 ]
1413 }
1414 }
1415 },
1416 "operator": {
1417 "begin": "(?x)\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\b(prefix|infix|postfix)\n\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(operator)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t | \\.\t\t\t\t\t\t\t\t\t# Invalid dot\n\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)*+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )++ )\t\t\t# Dot operators\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t",
1418 "beginCaptures": {
1419 "1": {
1420 "name": "storage.modifier.swift"
1421 },
1422 "2": {
1423 "name": "storage.type.function.operator.swift"
1424 },
1425 "3": {
1426 "name": "entity.name.function.operator.swift"
1427 },
1428 "4": {
1429 "patterns": [
1430 {
1431 "match": "\\.",
1432 "name": "invalid.illegal.dot-not-allowed-here.swift"
1433 }
1434 ]
1435 }
1436 },
1437 "end": "(;)|$\\n?|(?=//|/\\*)",
1438 "endCaptures": {
1439 "1": {
1440 "name": "punctuation.terminator.statement.swift"
1441 }
1442 },
1443 "name": "meta.definition.operator.swift",
1444 "patterns": [
1445 {
1446 "include": "#swift2"
1447 },
1448 {
1449 "include": "#swift3"
1450 },
1451 {
1452 "match": "((?!$|;|//|/\\*)\\S)+",
1453 "name": "invalid.illegal.character-not-allowed-here.swift"
1454 }
1455 ],
1456 "repository": {
1457 "swift2": {
1458 "begin": "\\G(\\{)",
1459 "beginCaptures": {
1460 "1": {
1461 "name": "punctuation.definition.operator.begin.swift"
1462 }
1463 },
1464 "end": "(\\})",
1465 "endCaptures": {
1466 "1": {
1467 "name": "punctuation.definition.operator.end.swift"
1468 }
1469 },
1470 "patterns": [
1471 {
1472 "include": "#comments"
1473 },
1474 {
1475 "captures": {
1476 "1": {
1477 "name": "storage.modifier.swift"
1478 },
1479 "2": {
1480 "name": "keyword.other.operator.associativity.swift"
1481 }
1482 },
1483 "match": "\\b(associativity)\\s+(left|right)\\b"
1484 },
1485 {
1486 "captures": {
1487 "1": {
1488 "name": "storage.modifier.swift"
1489 },
1490 "2": {
1491 "name": "constant.numeric.integer.swift"
1492 }
1493 },
1494 "match": "\\b(precedence)\\s+([0-9]+)\\b"
1495 },
1496 {
1497 "captures": {
1498 "1": {
1499 "name": "storage.modifier.swift"
1500 }
1501 },
1502 "match": "\\b(assignment)\\b"
1503 }
1504 ]
1505 },
1506 "swift3": {
1507 "captures": {
1508 "2": {
1509 "name": "entity.other.inherited-class.swift",
1510 "patterns": [
1511 {
1512 "include": "#types-precedencegroup"
1513 }
1514 ]
1515 },
1516 "3": {
1517 "name": "punctuation.definition.identifier.swift"
1518 },
1519 "4": {
1520 "name": "punctuation.definition.identifier.swift"
1521 }
1522 },
1523 "match": "\\G(:)\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
1524 }
1525 }
1526 },
1527 "parameter-clause": {
1528 "begin": "(\\()",
1529 "beginCaptures": {
1530 "1": {
1531 "name": "punctuation.definition.parameters.begin.swift"
1532 }
1533 },
1534 "end": "(\\))(?:\\s*(async)\\b)?",
1535 "endCaptures": {
1536 "1": {
1537 "name": "punctuation.definition.parameters.end.swift"
1538 },
1539 "2": {
1540 "name": "keyword.control.async.swift"
1541 }
1542 },
1543 "name": "meta.parameter-clause.swift",
1544 "patterns": [
1545 {
1546 "include": "#parameter-list"
1547 }
1548 ]
1549 },
1550 "parameter-list": {
1551 "patterns": [
1552 {
1553 "captures": {
1554 "1": {
1555 "name": "entity.name.function.swift"
1556 },
1557 "2": {
1558 "name": "punctuation.definition.identifier.swift"
1559 },
1560 "3": {
1561 "name": "punctuation.definition.identifier.swift"
1562 },
1563 "4": {
1564 "name": "variable.parameter.function.swift"
1565 },
1566 "5": {
1567 "name": "punctuation.definition.identifier.swift"
1568 },
1569 "6": {
1570 "name": "punctuation.definition.identifier.swift"
1571 }
1572 },
1573 "comment": "External parameter labels are considered part of the function name",
1574 "match": "((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q1>))\\s+((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q2>))(?=\\s*:)"
1575 },
1576 {
1577 "captures": {
1578 "1": {
1579 "name": "variable.parameter.function.swift"
1580 },
1581 "2": {
1582 "name": "entity.name.function.swift"
1583 },
1584 "3": {
1585 "name": "punctuation.definition.identifier.swift"
1586 },
1587 "4": {
1588 "name": "punctuation.definition.identifier.swift"
1589 }
1590 },
1591 "comment": "If no external label is given, the name is both the external label and the internal variable name",
1592 "match": "(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)))(?=\\s*:)"
1593 },
1594 {
1595 "begin": ":\\s*(?!\\s)",
1596 "end": "(?=[,)])",
1597 "patterns": [
1598 {
1599 "include": "#available-types"
1600 },
1601 {
1602 "match": ":",
1603 "name": "invalid.illegal.extra-colon-in-parameter-list.swift"
1604 },
1605 {
1606 "begin": "=",
1607 "beginCaptures": {
1608 "0": {
1609 "name": "keyword.operator.assignment.swift"
1610 }
1611 },
1612 "comment": "a parameter's default value",
1613 "end": "(?=[,)])",
1614 "patterns": [
1615 {
1616 "include": "#expressions"
1617 }
1618 ]
1619 }
1620 ]
1621 }
1622 ]
1623 },
1624 "precedencegroup": {
1625 "begin": "\\b(precedencegroup)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(?=\\{)",
1626 "beginCaptures": {
1627 "1": {
1628 "name": "storage.type.precedencegroup.swift"
1629 },
1630 "2": {
1631 "name": "entity.name.type.precedencegroup.swift"
1632 },
1633 "3": {
1634 "name": "punctuation.definition.identifier.swift"
1635 },
1636 "4": {
1637 "name": "punctuation.definition.identifier.swift"
1638 }
1639 },
1640 "end": "(?!\\G)",
1641 "name": "meta.definition.precedencegroup.swift",
1642 "patterns": [
1643 {
1644 "begin": "\\{",
1645 "beginCaptures": {
1646 "0": {
1647 "name": "punctuation.definition.precedencegroup.begin.swift"
1648 }
1649 },
1650 "end": "\\}",
1651 "endCaptures": {
1652 "0": {
1653 "name": "punctuation.definition.precedencegroup.end.swift"
1654 }
1655 },
1656 "patterns": [
1657 {
1658 "include": "#comments"
1659 },
1660 {
1661 "captures": {
1662 "1": {
1663 "name": "storage.modifier.swift"
1664 },
1665 "2": {
1666 "name": "entity.other.inherited-class.swift",
1667 "patterns": [
1668 {
1669 "include": "#types-precedencegroup"
1670 }
1671 ]
1672 },
1673 "3": {
1674 "name": "punctuation.definition.identifier.swift"
1675 },
1676 "4": {
1677 "name": "punctuation.definition.identifier.swift"
1678 }
1679 },
1680 "match": "\\b(higherThan|lowerThan)\\s*:\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
1681 },
1682 {
1683 "captures": {
1684 "1": {
1685 "name": "storage.modifier.swift"
1686 },
1687 "2": {
1688 "name": "keyword.other.operator.associativity.swift"
1689 }
1690 },
1691 "match": "\\b(associativity)\\b(?:\\s*:\\s*(right|left|none)\\b)?"
1692 },
1693 {
1694 "captures": {
1695 "1": {
1696 "name": "storage.modifier.swift"
1697 },
1698 "2": {
1699 "name": "constant.language.boolean.swift"
1700 }
1701 },
1702 "match": "\\b(assignment)\\b(?:\\s*:\\s*(true|false)\\b)?"
1703 }
1704 ]
1705 }
1706 ]
1707 },
1708 "protocol": {
1709 "begin": "\\b(protocol)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1710 "beginCaptures": {
1711 "1": {
1712 "name": "storage.type.$1.swift"
1713 },
1714 "2": {
1715 "name": "entity.name.type.$1.swift"
1716 },
1717 "3": {
1718 "name": "punctuation.definition.identifier.swift"
1719 },
1720 "4": {
1721 "name": "punctuation.definition.identifier.swift"
1722 }
1723 },
1724 "end": "(?<=\\})",
1725 "name": "meta.definition.type.protocol.swift",
1726 "patterns": [
1727 {
1728 "include": "#comments"
1729 },
1730 {
1731 "include": "#inheritance-clause"
1732 },
1733 {
1734 "comment": "SE-0142: Permit where clauses to constrain associated types",
1735 "include": "#generic-where-clause"
1736 },
1737 {
1738 "begin": "\\{",
1739 "beginCaptures": {
1740 "0": {
1741 "name": "punctuation.definition.type.begin.swift"
1742 }
1743 },
1744 "end": "\\}",
1745 "endCaptures": {
1746 "0": {
1747 "name": "punctuation.definition.type.end.swift"
1748 }
1749 },
1750 "name": "meta.definition.type.body.swift",
1751 "patterns": [
1752 {
1753 "include": "#protocol-method"
1754 },
1755 {
1756 "include": "#protocol-initializer"
1757 },
1758 {
1759 "include": "#associated-type"
1760 },
1761 {
1762 "include": "$self"
1763 }
1764 ]
1765 }
1766 ],
1767 "repository": {
1768 "associated-type": {
1769 "begin": "\\b(associatedtype)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
1770 "beginCaptures": {
1771 "1": {
1772 "name": "keyword.other.declaration-specifier.swift"
1773 },
1774 "2": {
1775 "name": "variable.language.associatedtype.swift"
1776 },
1777 "3": {
1778 "name": "punctuation.definition.identifier.swift"
1779 },
1780 "4": {
1781 "name": "punctuation.definition.identifier.swift"
1782 }
1783 },
1784 "end": "(?!\\G)$|(?=[;}]|$)",
1785 "name": "meta.definition.associatedtype.swift",
1786 "patterns": [
1787 {
1788 "include": "#inheritance-clause"
1789 },
1790 {
1791 "comment": "SE-0142: Permit where clauses to constrain associated types",
1792 "include": "#generic-where-clause"
1793 },
1794 {
1795 "include": "#typealias-assignment"
1796 }
1797 ]
1798 },
1799 "protocol-initializer": {
1800 "begin": "(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)",
1801 "beginCaptures": {
1802 "1": {
1803 "name": "storage.type.function.swift",
1804 "patterns": [
1805 {
1806 "match": "(?<=[?!])[?!]+",
1807 "name": "invalid.illegal.character-not-allowed-here.swift"
1808 }
1809 ]
1810 }
1811 },
1812 "end": "$|(?=;|//|/\\*|\\})",
1813 "name": "meta.definition.function.initializer.swift",
1814 "patterns": [
1815 {
1816 "include": "#comments"
1817 },
1818 {
1819 "include": "#generic-parameter-clause"
1820 },
1821 {
1822 "include": "#parameter-clause"
1823 },
1824 {
1825 "include": "#async-throws"
1826 },
1827 {
1828 "comment": "Swift 3: generic constraints after the parameters and return type",
1829 "include": "#generic-where-clause"
1830 },
1831 {
1832 "begin": "\\{",
1833 "beginCaptures": {
1834 "0": {
1835 "name": "punctuation.section.function.begin.swift"
1836 }
1837 },
1838 "end": "\\}",
1839 "endCaptures": {
1840 "0": {
1841 "name": "punctuation.section.function.end.swift"
1842 }
1843 },
1844 "name": "invalid.illegal.function-body-not-allowed-in-protocol.swift",
1845 "patterns": [
1846 {
1847 "include": "$self"
1848 }
1849 ]
1850 }
1851 ]
1852 },
1853 "protocol-method": {
1854 "begin": "(?x)\n\t\t\t\t\t\t\t\t\\b\n\t\t\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t \t\t\t\t\t\t | (?:\n\t\t \t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t \t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t \t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t \t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t \t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t \t\t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t)*\n\t\t \t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t \t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t\t\t",
1855 "beginCaptures": {
1856 "1": {
1857 "name": "storage.type.function.swift"
1858 },
1859 "2": {
1860 "name": "entity.name.function.swift"
1861 },
1862 "3": {
1863 "name": "punctuation.definition.identifier.swift"
1864 },
1865 "4": {
1866 "name": "punctuation.definition.identifier.swift"
1867 }
1868 },
1869 "end": "$|(?=;|//|/\\*|\\})",
1870 "name": "meta.definition.function.swift",
1871 "patterns": [
1872 {
1873 "include": "#comments"
1874 },
1875 {
1876 "include": "#generic-parameter-clause"
1877 },
1878 {
1879 "include": "#parameter-clause"
1880 },
1881 {
1882 "include": "#function-result"
1883 },
1884 {
1885 "include": "#async-throws"
1886 },
1887 {
1888 "comment": "Swift 3: generic constraints after the parameters and return type",
1889 "include": "#generic-where-clause"
1890 },
1891 {
1892 "begin": "\\{",
1893 "beginCaptures": {
1894 "0": {
1895 "name": "punctuation.section.function.begin.swift"
1896 }
1897 },
1898 "end": "\\}",
1899 "endCaptures": {
1900 "0": {
1901 "name": "punctuation.section.function.end.swift"
1902 }
1903 },
1904 "name": "invalid.illegal.function-body-not-allowed-in-protocol.swift",
1905 "patterns": [
1906 {
1907 "include": "$self"
1908 }
1909 ]
1910 }
1911 ]
1912 }
1913 }
1914 },
1915 "type": {
1916 "patterns": [
1917 {
1918 "begin": "\\b(class(?!\\s+(?:func|var|let)\\b)|struct|actor)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1919 "beginCaptures": {
1920 "1": {
1921 "name": "storage.type.$1.swift"
1922 },
1923 "2": {
1924 "name": "entity.name.type.$1.swift"
1925 },
1926 "3": {
1927 "name": "punctuation.definition.identifier.swift"
1928 },
1929 "4": {
1930 "name": "punctuation.definition.identifier.swift"
1931 }
1932 },
1933 "end": "(?<=\\})",
1934 "name": "meta.definition.type.$1.swift",
1935 "patterns": [
1936 {
1937 "include": "#comments"
1938 },
1939 {
1940 "include": "#generic-parameter-clause"
1941 },
1942 {
1943 "comment": "Swift 3: generic constraints after the generic param list",
1944 "include": "#generic-where-clause"
1945 },
1946 {
1947 "include": "#inheritance-clause"
1948 },
1949 {
1950 "begin": "\\{",
1951 "beginCaptures": {
1952 "0": {
1953 "name": "punctuation.definition.type.begin.swift"
1954 }
1955 },
1956 "end": "\\}",
1957 "endCaptures": {
1958 "0": {
1959 "name": "punctuation.definition.type.end.swift"
1960 }
1961 },
1962 "name": "meta.definition.type.body.swift",
1963 "patterns": [
1964 {
1965 "include": "$self"
1966 }
1967 ]
1968 }
1969 ]
1970 },
1971 {
1972 "include": "#type-enum"
1973 }
1974 ]
1975 },
1976 "type-enum": {
1977 "begin": "\\b(enum)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1978 "beginCaptures": {
1979 "1": {
1980 "name": "storage.type.$1.swift"
1981 },
1982 "2": {
1983 "name": "entity.name.type.$1.swift"
1984 },
1985 "3": {
1986 "name": "punctuation.definition.identifier.swift"
1987 },
1988 "4": {
1989 "name": "punctuation.definition.identifier.swift"
1990 }
1991 },
1992 "end": "(?<=\\})",
1993 "name": "meta.definition.type.$1.swift",
1994 "patterns": [
1995 {
1996 "include": "#comments"
1997 },
1998 {
1999 "include": "#generic-parameter-clause"
2000 },
2001 {
2002 "comment": "Swift 3: generic constraints after the generic param list",
2003 "include": "#generic-where-clause"
2004 },
2005 {
2006 "include": "#inheritance-clause"
2007 },
2008 {
2009 "begin": "\\{",
2010 "beginCaptures": {
2011 "0": {
2012 "name": "punctuation.definition.type.begin.swift"
2013 }
2014 },
2015 "end": "\\}",
2016 "endCaptures": {
2017 "0": {
2018 "name": "punctuation.definition.type.end.swift"
2019 }
2020 },
2021 "name": "meta.definition.type.body.swift",
2022 "patterns": [
2023 {
2024 "include": "#enum-case-clause"
2025 },
2026 {
2027 "include": "$self"
2028 }
2029 ]
2030 }
2031 ],
2032 "repository": {
2033 "associated-values": {
2034 "begin": "\\G\\(",
2035 "beginCaptures": {
2036 "0": {
2037 "name": "punctuation.definition.parameters.begin.swift"
2038 }
2039 },
2040 "end": "\\)",
2041 "endCaptures": {
2042 "0": {
2043 "name": "punctuation.definition.parameters.end.swift"
2044 }
2045 },
2046 "patterns": [
2047 {
2048 "include": "#comments"
2049 },
2050 {
2051 "begin": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?:(_)|((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q1>))\n\t\t\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t\t\t(((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q2>))\n\t\t\t\t\t\t\t\t\t\t\\s*(:)",
2052 "beginCaptures": {
2053 "1": {
2054 "name": "entity.name.function.swift"
2055 },
2056 "2": {
2057 "name": "invalid.illegal.distinct-labels-not-allowed.swift"
2058 },
2059 "5": {
2060 "name": "variable.parameter.function.swift"
2061 },
2062 "7": {
2063 "name": "punctuation.separator.argument-label.swift"
2064 }
2065 },
2066 "end": "(?=[,)\\]])",
2067 "patterns": [
2068 {
2069 "include": "#available-types"
2070 }
2071 ]
2072 },
2073 {
2074 "begin": "(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q>))\\s*(:)",
2075 "beginCaptures": {
2076 "1": {
2077 "name": "entity.name.function.swift"
2078 },
2079 "2": {
2080 "name": "variable.parameter.function.swift"
2081 },
2082 "4": {
2083 "name": "punctuation.separator.argument-label.swift"
2084 }
2085 },
2086 "end": "(?=[,)\\]])",
2087 "patterns": [
2088 {
2089 "include": "#available-types"
2090 }
2091 ]
2092 },
2093 {
2094 "begin": "(?![,)\\]])(?=\\S)",
2095 "comment": "an element without a label (i.e. anything else)",
2096 "end": "(?=[,)\\]])",
2097 "patterns": [
2098 {
2099 "include": "#available-types"
2100 },
2101 {
2102 "match": ":",
2103 "name": "invalid.illegal.extra-colon-in-parameter-list.swift"
2104 }
2105 ]
2106 }
2107 ]
2108 },
2109 "enum-case": {
2110 "begin": "(?x)((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2111 "beginCaptures": {
2112 "1": {
2113 "name": "constant.other.swift"
2114 }
2115 },
2116 "end": "(?<=\\))|(?![=(])",
2117 "patterns": [
2118 {
2119 "include": "#comments"
2120 },
2121 {
2122 "include": "#associated-values"
2123 },
2124 {
2125 "include": "#raw-value-assignment"
2126 }
2127 ]
2128 },
2129 "enum-case-clause": {
2130 "begin": "\\b(case)\\b\\s*",
2131 "beginCaptures": {
2132 "1": {
2133 "name": "storage.type.enum.case.swift"
2134 }
2135 },
2136 "end": "(?=[;}])|(?!\\G)(?!//|/\\*)(?=[^\\s,])",
2137 "patterns": [
2138 {
2139 "include": "#comments"
2140 },
2141 {
2142 "include": "#enum-case"
2143 },
2144 {
2145 "include": "#more-cases"
2146 }
2147 ]
2148 },
2149 "more-cases": {
2150 "begin": ",\\s*",
2151 "end": "(?!\\G)(?!//|/\\*)(?=[;}]|[^\\s,])",
2152 "name": "meta.enum-case.more-cases",
2153 "patterns": [
2154 {
2155 "include": "#comments"
2156 },
2157 {
2158 "include": "#enum-case"
2159 },
2160 {
2161 "include": "#more-cases"
2162 }
2163 ]
2164 },
2165 "raw-value-assignment": {
2166 "begin": "(=)\\s*",
2167 "beginCaptures": {
2168 "1": {
2169 "name": "keyword.operator.assignment.swift"
2170 }
2171 },
2172 "end": "(?!\\G)",
2173 "patterns": [
2174 {
2175 "include": "#comments"
2176 },
2177 {
2178 "include": "#literals"
2179 }
2180 ]
2181 }
2182 }
2183 },
2184 "type-identifier": {
2185 "begin": "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2186 "beginCaptures": {
2187 "1": {
2188 "name": "meta.type-name.swift",
2189 "patterns": [
2190 {
2191 "include": "#builtin-types"
2192 }
2193 ]
2194 },
2195 "2": {
2196 "name": "punctuation.definition.identifier.swift"
2197 },
2198 "3": {
2199 "name": "punctuation.definition.identifier.swift"
2200 }
2201 },
2202 "end": "(?!<)",
2203 "patterns": [
2204 {
2205 "begin": "(?=<)",
2206 "end": "(?!\\G)",
2207 "patterns": [
2208 {
2209 "include": "#generic-argument-clause"
2210 }
2211 ]
2212 }
2213 ]
2214 },
2215 "typealias": {
2216 "begin": "\\b(typealias)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2217 "beginCaptures": {
2218 "1": {
2219 "name": "keyword.other.declaration-specifier.swift"
2220 },
2221 "2": {
2222 "name": "entity.name.type.typealias.swift"
2223 },
2224 "3": {
2225 "name": "punctuation.definition.identifier.swift"
2226 },
2227 "4": {
2228 "name": "punctuation.definition.identifier.swift"
2229 }
2230 },
2231 "end": "(?!\\G)$|(?=;|//|/\\*|$)",
2232 "name": "meta.definition.typealias.swift",
2233 "patterns": [
2234 {
2235 "begin": "\\G(?=<)",
2236 "end": "(?!\\G)",
2237 "patterns": [
2238 {
2239 "include": "#generic-parameter-clause"
2240 }
2241 ]
2242 },
2243 {
2244 "include": "#typealias-assignment"
2245 }
2246 ]
2247 },
2248 "typealias-assignment": {
2249 "begin": "(=)\\s*",
2250 "beginCaptures": {
2251 "1": {
2252 "name": "keyword.operator.assignment.swift"
2253 }
2254 },
2255 "end": "(?!\\G)$|(?=;|//|/\\*|$)",
2256 "patterns": [
2257 {
2258 "include": "#available-types"
2259 }
2260 ]
2261 },
2262 "typed-variable-declaration": {
2263 "begin": "(?x)\n\t\t\t\t\t\t\\b(?:(async)\\s+)?(let|var)\\b\\s+\n\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\\s*\n\t\t\t\t\t\t:\n\t\t\t\t\t",
2264 "beginCaptures": {
2265 "1": {
2266 "name": "keyword.control.async.swift"
2267 },
2268 "2": {
2269 "name": "keyword.other.declaration-specifier.swift"
2270 }
2271 },
2272 "end": "(?=$|[={])",
2273 "patterns": [
2274 {
2275 "include": "#available-types"
2276 }
2277 ]
2278 },
2279 "types-precedencegroup": {
2280 "patterns": [
2281 {
2282 "comment": "Precedence groups in the standard library",
2283 "match": "\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\b",
2284 "name": "support.type.swift"
2285 }
2286 ]
2287 }
2288 }
2289 },
2290 "expressions": {
2291 "patterns": [
2292 {
2293 "include": "#comments"
2294 },
2295 {
2296 "include": "#code-block"
2297 },
2298 {
2299 "include": "#attributes"
2300 },
2301 {
2302 "include": "#closure-parameter"
2303 },
2304 {
2305 "include": "#literals"
2306 },
2307 {
2308 "include": "#operators"
2309 },
2310 {
2311 "include": "#builtin-types"
2312 },
2313 {
2314 "include": "#builtin-functions"
2315 },
2316 {
2317 "include": "#builtin-global-functions"
2318 },
2319 {
2320 "include": "#builtin-properties"
2321 },
2322 {
2323 "include": "#compound-name"
2324 },
2325 {
2326 "include": "#keywords"
2327 },
2328 {
2329 "include": "#function-call-expression"
2330 },
2331 {
2332 "include": "#subscript-expression"
2333 },
2334 {
2335 "include": "#parenthesized-expression"
2336 },
2337 {
2338 "include": "#member-reference"
2339 },
2340 {
2341 "include": "#availability-condition"
2342 },
2343 {
2344 "match": "\\b_\\b",
2345 "name": "support.variable.discard-value.swift"
2346 }
2347 ],
2348 "repository": {
2349 "availability-condition": {
2350 "begin": "\\B(#(?:un)?available)(\\()",
2351 "beginCaptures": {
2352 "1": {
2353 "name": "support.function.availability-condition.swift"
2354 },
2355 "2": {
2356 "name": "punctuation.definition.arguments.begin.swift"
2357 }
2358 },
2359 "end": "\\)",
2360 "endCaptures": {
2361 "0": {
2362 "name": "punctuation.definition.arguments.end.swift"
2363 }
2364 },
2365 "patterns": [
2366 {
2367 "captures": {
2368 "1": {
2369 "name": "keyword.other.platform.os.swift"
2370 },
2371 "2": {
2372 "name": "constant.numeric.swift"
2373 }
2374 },
2375 "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))"
2376 },
2377 {
2378 "captures": {
2379 "1": {
2380 "name": "keyword.other.platform.all.swift"
2381 },
2382 "2": {
2383 "name": "invalid.illegal.character-not-allowed-here.swift"
2384 }
2385 },
2386 "match": "(\\*)\\s*(.*?)(?=[,)])"
2387 },
2388 {
2389 "match": "[^\\s,)]+",
2390 "name": "invalid.illegal.character-not-allowed-here.swift"
2391 }
2392 ]
2393 },
2394 "closure-parameter": {
2395 "match": "\\$[0-9]+",
2396 "name": "variable.language.closure-parameter.swift"
2397 },
2398 "compound-name": {
2399 "captures": {
2400 "1": {
2401 "name": "entity.name.function.compound-name.swift"
2402 },
2403 "2": {
2404 "name": "punctuation.definition.entity.swift"
2405 },
2406 "3": {
2407 "name": "punctuation.definition.entity.swift"
2408 },
2409 "4": {
2410 "patterns": [
2411 {
2412 "captures": {
2413 "1": {
2414 "name": "punctuation.definition.entity.swift"
2415 },
2416 "2": {
2417 "name": "punctuation.definition.entity.swift"
2418 }
2419 },
2420 "match": "(?<q>`?)(?!_:)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>):",
2421 "name": "entity.name.function.compound-name.swift"
2422 }
2423 ]
2424 }
2425 },
2426 "comment": "a reference to a function with disambiguating argument labels, such as foo(_:), foo(bar:), etc.",
2427 "match": "(?x)\n\t\t\t\t\t\t((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q1>)) \t\t# function name\n\t\t\t\t\t\t\\(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q2>)) \t# argument label\n\t\t\t\t\t\t\t\t\t:\t\t\t\t\t\t\t\t\t\t\t\t# colon\n\t\t\t\t\t\t\t\t)+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\\)\n\t\t\t\t\t"
2428 },
2429 "expression-element-list": {
2430 "patterns": [
2431 {
2432 "include": "#comments"
2433 },
2434 {
2435 "begin": "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(:)",
2436 "beginCaptures": {
2437 "1": {
2438 "name": "support.function.any-method.swift"
2439 },
2440 "2": {
2441 "name": "punctuation.definition.identifier.swift"
2442 },
2443 "3": {
2444 "name": "punctuation.definition.identifier.swift"
2445 },
2446 "4": {
2447 "name": "punctuation.separator.argument-label.swift"
2448 }
2449 },
2450 "comment": "an element with a label",
2451 "end": "(?=[,)\\]])",
2452 "patterns": [
2453 {
2454 "include": "#expressions"
2455 }
2456 ]
2457 },
2458 {
2459 "begin": "(?![,)\\]])(?=\\S)",
2460 "comment": "an element without a label (i.e. anything else)",
2461 "end": "(?=[,)\\]])",
2462 "patterns": [
2463 {
2464 "include": "#expressions"
2465 }
2466 ]
2467 }
2468 ]
2469 },
2470 "function-call-expression": {
2471 "patterns": [
2472 {
2473 "begin": "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(\\()",
2474 "beginCaptures": {
2475 "1": {
2476 "name": "support.function.any-method.swift"
2477 },
2478 "2": {
2479 "name": "punctuation.definition.identifier.swift"
2480 },
2481 "3": {
2482 "name": "punctuation.definition.identifier.swift"
2483 },
2484 "4": {
2485 "name": "punctuation.definition.arguments.begin.swift"
2486 }
2487 },
2488 "comment": "foo(args) -- a call whose callee is a highlightable name",
2489 "end": "\\)",
2490 "endCaptures": {
2491 "0": {
2492 "name": "punctuation.definition.arguments.end.swift"
2493 }
2494 },
2495 "name": "meta.function-call.swift",
2496 "patterns": [
2497 {
2498 "include": "#expression-element-list"
2499 }
2500 ]
2501 },
2502 {
2503 "begin": "(?<=[`\\])}>\\p{L}_\\p{N}\\p{M}])\\s*(\\()",
2504 "beginCaptures": {
2505 "1": {
2506 "name": "punctuation.definition.arguments.begin.swift"
2507 }
2508 },
2509 "comment": "[Int](args) -- a call whose callee is a more complicated expression",
2510 "end": "\\)",
2511 "endCaptures": {
2512 "0": {
2513 "name": "punctuation.definition.arguments.end.swift"
2514 }
2515 },
2516 "name": "meta.function-call.swift",
2517 "patterns": [
2518 {
2519 "include": "#expression-element-list"
2520 }
2521 ]
2522 }
2523 ]
2524 },
2525 "member-reference": {
2526 "patterns": [
2527 {
2528 "captures": {
2529 "1": {
2530 "name": "variable.other.swift"
2531 },
2532 "2": {
2533 "name": "punctuation.definition.identifier.swift"
2534 },
2535 "3": {
2536 "name": "punctuation.definition.identifier.swift"
2537 }
2538 },
2539 "match": "(?<=\\.)((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
2540 }
2541 ]
2542 },
2543 "parenthesized-expression": {
2544 "begin": "\\(",
2545 "beginCaptures": {
2546 "0": {
2547 "name": "punctuation.section.tuple.begin.swift"
2548 }
2549 },
2550 "comment": "correctly matching closure expressions is too hard (depends on trailing \"in\") so we just tack on some basics to the end of parenthesized-expression",
2551 "end": "(\\))\\s*((?:\\b(?:async|throws|rethrows)\\s)*)",
2552 "endCaptures": {
2553 "1": {
2554 "name": "punctuation.section.tuple.end.swift"
2555 },
2556 "2": {
2557 "patterns": [
2558 {
2559 "match": "\\brethrows\\b",
2560 "name": "invalid.illegal.rethrows-only-allowed-on-function-declarations.swift"
2561 },
2562 {
2563 "include": "#async-throws"
2564 }
2565 ]
2566 }
2567 },
2568 "patterns": [
2569 {
2570 "include": "#expression-element-list"
2571 }
2572 ]
2573 },
2574 "subscript-expression": {
2575 "begin": "(?<=[`\\p{L}_\\p{N}\\p{M}])\\s*(\\[)",
2576 "beginCaptures": {
2577 "1": {
2578 "name": "punctuation.definition.arguments.begin.swift"
2579 }
2580 },
2581 "end": "\\]",
2582 "endCaptures": {
2583 "0": {
2584 "name": "punctuation.definition.arguments.end.swift"
2585 }
2586 },
2587 "name": "meta.subscript-expression.swift",
2588 "patterns": [
2589 {
2590 "include": "#expression-element-list"
2591 }
2592 ]
2593 }
2594 }
2595 },
2596 "keywords": {
2597 "patterns": [
2598 {
2599 "match": "(?<!\\.)\\b(?:if|else|guard|where|switch|case|default|fallthrough)\\b",
2600 "name": "keyword.control.branch.swift"
2601 },
2602 {
2603 "match": "(?<!\\.)\\b(?:continue|break|fallthrough|return)\\b",
2604 "name": "keyword.control.transfer.swift"
2605 },
2606 {
2607 "match": "(?<!\\.)\\b(?:while|for|in)\\b",
2608 "name": "keyword.control.loop.swift"
2609 },
2610 {
2611 "captures": {
2612 "1": {
2613 "name": "keyword.control.loop.swift"
2614 },
2615 "2": {
2616 "name": "punctuation.whitespace.trailing.repeat.swift"
2617 }
2618 },
2619 "comment": "extra scopes for repeat-while snippet",
2620 "match": "(?<!\\.)\\b(repeat)\\b(\\s*)"
2621 },
2622 {
2623 "match": "(?<!\\.)\\bdefer\\b",
2624 "name": "keyword.control.defer.swift"
2625 },
2626 {
2627 "captures": {
2628 "1": {
2629 "name": "invalid.illegal.try-must-precede-await.swift"
2630 },
2631 "2": {
2632 "name": "keyword.control.await.swift"
2633 }
2634 },
2635 "match": "(?<!\\.)\\b(?:(await\\s+try)|(await)\\b)"
2636 },
2637 {
2638 "match": "(?<!\\.)\\b(?:catch|throws?|rethrows|try)\\b|\\btry[?!]\\B",
2639 "name": "keyword.control.exception.swift"
2640 },
2641 {
2642 "captures": {
2643 "1": {
2644 "name": "keyword.control.exception.swift"
2645 },
2646 "2": {
2647 "name": "punctuation.whitespace.trailing.do.swift"
2648 }
2649 },
2650 "comment": "extra scopes for do-catch snippet",
2651 "match": "(?<!\\.)\\b(do)\\b(\\s*)"
2652 },
2653 {
2654 "captures": {
2655 "1": {
2656 "name": "keyword.control.async.swift"
2657 },
2658 "2": {
2659 "name": "storage.modifier.swift"
2660 },
2661 "3": {
2662 "name": "keyword.other.declaration-specifier.swift"
2663 }
2664 },
2665 "match": "(?<!\\.)\\b(?:(?:(async)|(nonisolated))\\s+)?(let|var)\\b"
2666 },
2667 {
2668 "match": "(?<!\\.)\\b(?:associatedtype|operator|typealias)\\b",
2669 "name": "keyword.other.declaration-specifier.swift"
2670 },
2671 {
2672 "match": "(?<!\\.)\\b(class|enum|extension|precedencegroup|protocol|struct|actor)\\b",
2673 "name": "storage.type.$1.swift"
2674 },
2675 {
2676 "match": "(?<!\\.)\\b(?:inout|static|final|lazy|mutating|nonmutating|optional|indirect|required|override|dynamic|convenience|infix|prefix|postfix)\\b",
2677 "name": "storage.modifier.swift"
2678 },
2679 {
2680 "match": "\\binit[?!]|\\binit\\b|(?<!\\.)\\b(?:func|deinit|subscript|didSet|get|set|willSet)\\b",
2681 "name": "storage.type.function.swift"
2682 },
2683 {
2684 "match": "(?<!\\.)\\b(?:fileprivate|private|internal|public|open)\\b",
2685 "name": "keyword.other.declaration-specifier.accessibility.swift"
2686 },
2687 {
2688 "comment": "matches weak, unowned, unowned(safe), unowned(unsafe)",
2689 "match": "(?<!\\.)\\bunowned\\((?:safe|unsafe)\\)|(?<!\\.)\\b(?:weak|unowned)\\b",
2690 "name": "keyword.other.capture-specifier.swift"
2691 },
2692 {
2693 "captures": {
2694 "1": {
2695 "name": "keyword.operator.type.swift"
2696 },
2697 "2": {
2698 "name": "keyword.operator.type.metatype.swift"
2699 }
2700 },
2701 "match": "(?<=\\.)(?:(dynamicType|self)|(Protocol|Type))\\b"
2702 },
2703 {
2704 "match": "(?<!\\.)\\b(?:super|self|Self)\\b",
2705 "name": "variable.language.swift"
2706 },
2707 {
2708 "match": "\\B(?:#file|#filePath|#fileID|#line|#column|#function|#dsohandle)\\b|\\b(?:__FILE__|__LINE__|__COLUMN__|__FUNCTION__|__DSO_HANDLE__)\\b",
2709 "name": "support.variable.swift"
2710 },
2711 {
2712 "match": "(?<!\\.)\\bimport\\b",
2713 "name": "keyword.control.import.swift"
2714 }
2715 ]
2716 },
2717 "literals": {
2718 "patterns": [
2719 {
2720 "include": "#boolean"
2721 },
2722 {
2723 "include": "#numeric"
2724 },
2725 {
2726 "include": "#string"
2727 },
2728 {
2729 "match": "\\bnil\\b",
2730 "name": "constant.language.nil.swift"
2731 },
2732 {
2733 "comment": "object \"literals\" used in playgrounds",
2734 "match": "\\B#(colorLiteral|imageLiteral|fileLiteral)\\b",
2735 "name": "support.function.object-literal.swift"
2736 },
2737 {
2738 "match": "\\B#keyPath\\b",
2739 "name": "support.function.key-path.swift"
2740 },
2741 {
2742 "begin": "\\B(#selector)(\\()(?:\\s*(getter|setter)\\s*(:))?",
2743 "beginCaptures": {
2744 "1": {
2745 "name": "support.function.selector-reference.swift"
2746 },
2747 "2": {
2748 "name": "punctuation.definition.arguments.begin.swift"
2749 },
2750 "3": {
2751 "name": "support.variable.parameter.swift"
2752 },
2753 "4": {
2754 "name": "punctuation.separator.argument-label.swift"
2755 }
2756 },
2757 "end": "\\)",
2758 "endCaptures": {
2759 "0": {
2760 "name": "punctuation.definition.arguments.end.swift"
2761 }
2762 },
2763 "patterns": [
2764 {
2765 "include": "#expressions"
2766 }
2767 ]
2768 }
2769 ],
2770 "repository": {
2771 "boolean": {
2772 "match": "\\b(true|false)\\b",
2773 "name": "constant.language.boolean.swift"
2774 },
2775 "numeric": {
2776 "patterns": [
2777 {
2778 "comment": "0.1, -4_2.5, 6.022e23, 10E-5",
2779 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9][0-9_]*(?=\\.[0-9]|[eE])(?:\\.[0-9][0-9_]*)?(?:[eE][-+]?[0-9][0-9_]*)?\\b(?!\\.[0-9])",
2780 "name": "constant.numeric.float.decimal.swift"
2781 },
2782 {
2783 "comment": "-0x1.ap2_3, 0x31p-4",
2784 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?[pP][-+]?[0-9][0-9_]*\\b(?!\\.[0-9])",
2785 "name": "constant.numeric.float.hexadecimal.swift"
2786 },
2787 {
2788 "comment": "0x1p, 0x1p_2, 0x1.5pa, 0x1.1p+1f, 0x1pz",
2789 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?(?:[pP][-+]?\\w*)\\b(?!\\.[0-9])",
2790 "name": "invalid.illegal.numeric.float.invalid-exponent.swift"
2791 },
2792 {
2793 "comment": "0x1.5w (note that 0x1.f may be a valid expression)",
2794 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)\\.[0-9][\\w.]*",
2795 "name": "invalid.illegal.numeric.float.missing-exponent.swift"
2796 },
2797 {
2798 "comment": "-.5, .2f (note that 1.-.5 may be a valid expression)",
2799 "match": "(?<=\\s|^)\\-?\\.[0-9][\\w.]*",
2800 "name": "invalid.illegal.numeric.float.missing-leading-zero.swift"
2801 },
2802 {
2803 "comment": "0b_0_1, 0x_1p+3q",
2804 "match": "(\\B\\-|\\b)0[box]_[0-9a-fA-F_]*(?:[pPeE][+-]?\\w+)?[\\w.]+",
2805 "name": "invalid.illegal.numeric.leading-underscore.swift"
2806 },
2807 {
2808 "comment": "tuple positional member: not really a numeric literal, but not invalid",
2809 "match": "(?<=[\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9]+\\b"
2810 },
2811 {
2812 "comment": "0b010, 0b1_0",
2813 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0b[01][01_]*\\b(?!\\.[0-9])",
2814 "name": "constant.numeric.integer.binary.swift"
2815 },
2816 {
2817 "comment": "0o1, 0o7_3",
2818 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0o[0-7][0-7_]*\\b(?!\\.[0-9])",
2819 "name": "constant.numeric.integer.octal.swift"
2820 },
2821 {
2822 "comment": "02, 3_456",
2823 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9][0-9_]*\\b(?!\\.[0-9])",
2824 "name": "constant.numeric.integer.decimal.swift"
2825 },
2826 {
2827 "comment": "0x4, 0xF_7",
2828 "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0x[0-9a-fA-F][0-9a-fA-F_]*\\b(?!\\.[0-9])",
2829 "name": "constant.numeric.integer.hexadecimal.swift"
2830 },
2831 {
2832 "match": "(\\B\\-|\\b)[0-9][\\w.]*",
2833 "name": "invalid.illegal.numeric.other.swift"
2834 }
2835 ]
2836 },
2837 "string": {
2838 "patterns": [
2839 {
2840 "begin": "\"\"\"",
2841 "beginCaptures": {
2842 "0": {
2843 "name": "punctuation.definition.string.begin.swift"
2844 }
2845 },
2846 "comment": "SE-0168: Multi-Line String Literals",
2847 "end": "\"\"\"(#*)",
2848 "endCaptures": {
2849 "0": {
2850 "name": "punctuation.definition.string.end.swift"
2851 },
2852 "1": {
2853 "name": "invalid.illegal.extra-closing-delimiter.swift"
2854 }
2855 },
2856 "name": "string.quoted.double.block.swift",
2857 "patterns": [
2858 {
2859 "match": "\\G.+(?=\"\"\")|\\G.+",
2860 "name": "invalid.illegal.content-after-opening-delimiter.swift"
2861 },
2862 {
2863 "match": "\\\\\\s*\\n",
2864 "name": "constant.character.escape.newline.swift"
2865 },
2866 {
2867 "include": "#string-guts"
2868 },
2869 {
2870 "comment": "Allow \\(\"\"\"...\"\"\") to appear inside a block string",
2871 "match": "\\S((?!\\\\\\().)*(?=\"\"\")",
2872 "name": "invalid.illegal.content-before-closing-delimiter.swift"
2873 }
2874 ]
2875 },
2876 {
2877 "begin": "#\"\"\"",
2878 "beginCaptures": {
2879 "0": {
2880 "name": "punctuation.definition.string.begin.swift"
2881 }
2882 },
2883 "end": "\"\"\"#(#*)",
2884 "endCaptures": {
2885 "0": {
2886 "name": "punctuation.definition.string.end.swift"
2887 },
2888 "1": {
2889 "name": "invalid.illegal.extra-closing-delimiter.swift"
2890 }
2891 },
2892 "name": "string.quoted.double.block.raw.swift",
2893 "patterns": [
2894 {
2895 "match": "\\G.+(?=\"\"\")|\\G.+",
2896 "name": "invalid.illegal.content-after-opening-delimiter.swift"
2897 },
2898 {
2899 "match": "\\\\#\\s*\\n",
2900 "name": "constant.character.escape.newline.swift"
2901 },
2902 {
2903 "include": "#raw-string-guts"
2904 },
2905 {
2906 "comment": "Allow \\(\"\"\"...\"\"\") to appear inside a block string",
2907 "match": "\\S((?!\\\\#\\().)*(?=\"\"\")",
2908 "name": "invalid.illegal.content-before-closing-delimiter.swift"
2909 }
2910 ]
2911 },
2912 {
2913 "begin": "(##+)\"\"\"",
2914 "beginCaptures": {
2915 "0": {
2916 "name": "punctuation.definition.string.begin.swift"
2917 }
2918 },
2919 "end": "\"\"\"\\1(#*)",
2920 "endCaptures": {
2921 "0": {
2922 "name": "punctuation.definition.string.end.swift"
2923 },
2924 "1": {
2925 "name": "invalid.illegal.extra-closing-delimiter.swift"
2926 }
2927 },
2928 "name": "string.quoted.double.block.raw.swift",
2929 "patterns": [
2930 {
2931 "match": "\\G.+(?=\"\"\")|\\G.+",
2932 "name": "invalid.illegal.content-after-opening-delimiter.swift"
2933 }
2934 ]
2935 },
2936 {
2937 "begin": "\"",
2938 "beginCaptures": {
2939 "0": {
2940 "name": "punctuation.definition.string.begin.swift"
2941 }
2942 },
2943 "end": "\"(#*)",
2944 "endCaptures": {
2945 "0": {
2946 "name": "punctuation.definition.string.end.swift"
2947 },
2948 "1": {
2949 "name": "invalid.illegal.extra-closing-delimiter.swift"
2950 }
2951 },
2952 "name": "string.quoted.double.single-line.swift",
2953 "patterns": [
2954 {
2955 "match": "\\r|\\n",
2956 "name": "invalid.illegal.returns-not-allowed.swift"
2957 },
2958 {
2959 "include": "#string-guts"
2960 }
2961 ]
2962 },
2963 {
2964 "begin": "(##+)\"",
2965 "beginCaptures": {
2966 "0": {
2967 "name": "punctuation.definition.string.begin.raw.swift"
2968 }
2969 },
2970 "comment": "SE-0168: raw string literals (more than one #, grammar limitations prevent us from supporting escapes)",
2971 "end": "\"\\1(#*)",
2972 "endCaptures": {
2973 "0": {
2974 "name": "punctuation.definition.string.end.raw.swift"
2975 },
2976 "1": {
2977 "name": "invalid.illegal.extra-closing-delimiter.swift"
2978 }
2979 },
2980 "name": "string.quoted.double.single-line.raw.swift",
2981 "patterns": [
2982 {
2983 "match": "\\r|\\n",
2984 "name": "invalid.illegal.returns-not-allowed.swift"
2985 }
2986 ]
2987 },
2988 {
2989 "begin": "#\"",
2990 "beginCaptures": {
2991 "0": {
2992 "name": "punctuation.definition.string.begin.raw.swift"
2993 }
2994 },
2995 "comment": "SE-0168: raw string literals (one #, escapes supported)",
2996 "end": "\"#(#*)",
2997 "endCaptures": {
2998 "0": {
2999 "name": "punctuation.definition.string.end.raw.swift"
3000 },
3001 "1": {
3002 "name": "invalid.illegal.extra-closing-delimiter.swift"
3003 }
3004 },
3005 "name": "string.quoted.double.single-line.raw.swift",
3006 "patterns": [
3007 {
3008 "match": "\\r|\\n",
3009 "name": "invalid.illegal.returns-not-allowed.swift"
3010 },
3011 {
3012 "include": "#raw-string-guts"
3013 }
3014 ]
3015 }
3016 ],
3017 "repository": {
3018 "raw-string-guts": {
3019 "comment": "the same as #string-guts but with # in escapes",
3020 "patterns": [
3021 {
3022 "match": "\\\\#[0\\\\tnr\"']",
3023 "name": "constant.character.escape.swift"
3024 },
3025 {
3026 "match": "\\\\#u\\{[0-9a-fA-F]{1,8}\\}",
3027 "name": "constant.character.escape.unicode.swift"
3028 },
3029 {
3030 "begin": "\\\\#\\(",
3031 "beginCaptures": {
3032 "0": {
3033 "name": "punctuation.section.embedded.begin.swift"
3034 }
3035 },
3036 "contentName": "source.swift",
3037 "end": "(\\))",
3038 "endCaptures": {
3039 "0": {
3040 "name": "punctuation.section.embedded.end.swift"
3041 },
3042 "1": {
3043 "name": "source.swift"
3044 }
3045 },
3046 "name": "meta.embedded.line.swift",
3047 "patterns": [
3048 {
3049 "include": "$self"
3050 },
3051 {
3052 "begin": "\\(",
3053 "comment": "Nested parens",
3054 "end": "\\)"
3055 }
3056 ]
3057 },
3058 {
3059 "match": "\\\\#.",
3060 "name": "invalid.illegal.escape-not-recognized"
3061 }
3062 ]
3063 },
3064 "string-guts": {
3065 "patterns": [
3066 {
3067 "match": "\\\\[0\\\\tnr\"']",
3068 "name": "constant.character.escape.swift"
3069 },
3070 {
3071 "match": "\\\\u\\{[0-9a-fA-F]{1,8}\\}",
3072 "name": "constant.character.escape.unicode.swift"
3073 },
3074 {
3075 "begin": "\\\\\\(",
3076 "beginCaptures": {
3077 "0": {
3078 "name": "punctuation.section.embedded.begin.swift"
3079 }
3080 },
3081 "contentName": "source.swift",
3082 "end": "(\\))",
3083 "endCaptures": {
3084 "0": {
3085 "name": "punctuation.section.embedded.end.swift"
3086 },
3087 "1": {
3088 "name": "source.swift"
3089 }
3090 },
3091 "name": "meta.embedded.line.swift",
3092 "patterns": [
3093 {
3094 "include": "$self"
3095 },
3096 {
3097 "begin": "\\(",
3098 "comment": "Nested parens",
3099 "end": "\\)"
3100 }
3101 ]
3102 },
3103 {
3104 "match": "\\\\.",
3105 "name": "invalid.illegal.escape-not-recognized"
3106 }
3107 ]
3108 }
3109 }
3110 }
3111 }
3112 },
3113 "operators": {
3114 "patterns": [
3115 {
3116 "comment": "Type casting",
3117 "match": "\\b(is\\b|as([!?]\\B|\\b))",
3118 "name": "keyword.operator.type-casting.swift"
3119 },
3120 {
3121 "begin": "(?x)\n\t\t\t\t\t\t(?=\n\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\\g<oph>\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t",
3122 "comment": "This rule helps us speed up the matching.",
3123 "end": "(?!\\G)",
3124 "patterns": [
3125 {
3126 "captures": {
3127 "0": {
3128 "patterns": [
3129 {
3130 "match": "\\G(\\+\\+|\\-\\-)$",
3131 "name": "keyword.operator.increment-or-decrement.swift"
3132 },
3133 {
3134 "match": "\\G(\\+|\\-)$",
3135 "name": "keyword.operator.arithmetic.unary.swift"
3136 },
3137 {
3138 "match": "\\G!$",
3139 "name": "keyword.operator.logical.not.swift"
3140 },
3141 {
3142 "match": "\\G~$",
3143 "name": "keyword.operator.bitwise.not.swift"
3144 },
3145 {
3146 "match": ".+",
3147 "name": "keyword.operator.custom.prefix.swift"
3148 }
3149 ]
3150 }
3151 },
3152 "comment": "Prefix unary operator",
3153 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3154 },
3155 {
3156 "captures": {
3157 "0": {
3158 "patterns": [
3159 {
3160 "match": "\\G(\\+\\+|\\-\\-)$",
3161 "name": "keyword.operator.increment-or-decrement.swift"
3162 },
3163 {
3164 "match": "\\G!$",
3165 "name": "keyword.operator.increment-or-decrement.swift"
3166 },
3167 {
3168 "match": ".+",
3169 "name": "keyword.operator.custom.postfix.swift"
3170 }
3171 ]
3172 }
3173 },
3174 "comment": "Postfix unary operator",
3175 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<!^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3176 },
3177 {
3178 "captures": {
3179 "0": {
3180 "patterns": [
3181 {
3182 "match": "\\G=$",
3183 "name": "keyword.operator.assignment.swift"
3184 },
3185 {
3186 "match": "\\G(\\+|\\-|\\*|/|%|<<|>>|&|\\^|\\||&&|\\|\\|)=$",
3187 "name": "keyword.operator.assignment.compound.swift"
3188 },
3189 {
3190 "match": "\\G(\\+|\\-|\\*|/)$",
3191 "name": "keyword.operator.arithmetic.swift"
3192 },
3193 {
3194 "match": "\\G&(\\+|\\-|\\*)$",
3195 "name": "keyword.operator.arithmetic.overflow.swift"
3196 },
3197 {
3198 "match": "\\G%$",
3199 "name": "keyword.operator.arithmetic.remainder.swift"
3200 },
3201 {
3202 "match": "\\G(==|!=|>|<|>=|<=|~=)$",
3203 "name": "keyword.operator.comparison.swift"
3204 },
3205 {
3206 "match": "\\G\\?\\?$",
3207 "name": "keyword.operator.coalescing.swift"
3208 },
3209 {
3210 "match": "\\G(&&|\\|\\|)$",
3211 "name": "keyword.operator.logical.swift"
3212 },
3213 {
3214 "match": "\\G(&|\\||\\^|<<|>>)$",
3215 "name": "keyword.operator.bitwise.swift"
3216 },
3217 {
3218 "match": "\\G(===|!==)$",
3219 "name": "keyword.operator.bitwise.swift"
3220 },
3221 {
3222 "match": "\\G\\?$",
3223 "name": "keyword.operator.ternary.swift"
3224 },
3225 {
3226 "match": ".+",
3227 "name": "keyword.operator.custom.infix.swift"
3228 }
3229 ]
3230 }
3231 },
3232 "comment": "Infix operator",
3233 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t"
3234 },
3235 {
3236 "captures": {
3237 "0": {
3238 "patterns": [
3239 {
3240 "match": ".+",
3241 "name": "keyword.operator.custom.prefix.dot.swift"
3242 }
3243 ]
3244 }
3245 },
3246 "comment": "Dot prefix unary operator",
3247 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3248 },
3249 {
3250 "captures": {
3251 "0": {
3252 "patterns": [
3253 {
3254 "match": ".+",
3255 "name": "keyword.operator.custom.postfix.dot.swift"
3256 }
3257 ]
3258 }
3259 },
3260 "comment": "Dot postfix unary operator",
3261 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<!^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3262 },
3263 {
3264 "captures": {
3265 "0": {
3266 "patterns": [
3267 {
3268 "match": "\\G\\.\\.[.<]$",
3269 "name": "keyword.operator.range.swift"
3270 },
3271 {
3272 "match": ".+",
3273 "name": "keyword.operator.custom.infix.dot.swift"
3274 }
3275 ]
3276 }
3277 },
3278 "comment": "Dot infix operator",
3279 "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t"
3280 }
3281 ]
3282 },
3283 {
3284 "match": ":",
3285 "name": "keyword.operator.ternary.swift"
3286 }
3287 ]
3288 },
3289 "root": {
3290 "patterns": [
3291 {
3292 "include": "#compiler-control"
3293 },
3294 {
3295 "include": "#declarations"
3296 },
3297 {
3298 "include": "#expressions"
3299 }
3300 ]
3301 }
3302 }
3303 }
3304