UNPKG

code-server

Version:

Run VS Code on a remote server.

1 lines 101 kB
{"information_for_contributors":["This file has been converted from https://github.com/jtbandes/swift-tmlanguage/blob/master/Swift.tmLanguage.json","If you want to provide a fix or improvement, please create a pull request against the original repository.","Once accepted there, we are happy to receive an update request."],"version":"https://github.com/jtbandes/swift-tmlanguage/commit/b8d2889b4af1d8bad41578317a6adade642555a3","name":"Swift","scopeName":"source.swift","comment":"See swift.tmbundle/grammar-test.swift for test cases.","patterns":[{"include":"#root"}],"repository":{"async-throws":{"match":"\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b","captures":{"1":{"name":"invalid.illegal.await-must-precede-throws.swift"},"2":{"name":"storage.modifier.exception.swift"},"3":{"name":"storage.modifier.async.swift"}}},"attributes":{"patterns":[{"name":"meta.attribute.available.swift","begin":"((@)available)(\\()","end":"\\)","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"match":"\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?","captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}}},{"begin":"\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*","end":"(?!\\G)","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"patterns":[{"name":"constant.numeric.swift","match":"\\b[0-9]+(?:\\.[0-9]+)*\\b"}]},{"begin":"\\b(message|renamed)\\s*(:)\\s*(?=\")","end":"(?!\\G)","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"patterns":[{"include":"#literals"}]},{"match":"(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])","captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"keyword.other.swift"},"3":{"name":"invalid.illegal.character-not-allowed-here.swift"}}}]},{"name":"meta.attribute.objc.swift","begin":"((@)objc)(\\()","end":"\\)","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"name":"entity.name.function.swift","match":"\\w*(?::(?:\\w*:)*(\\w*))?","captures":{"1":{"name":"invalid.illegal.missing-colon-after-selector-piece.swift"}}}]},{"comment":"any other attribute","name":"meta.attribute.swift","begin":"(@)(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)","end":"(?!\\G\\()","beginCaptures":{"0":{"name":"storage.modifier.attribute.swift"},"1":{"name":"punctuation.definition.attribute.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"name":"meta.arguments.attribute.swift","begin":"\\(","end":"\\)","beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]}]}]},"builtin-functions":{"patterns":[{"comment":"Member functions in the standard library in Swift 3 which may be used with trailing closures and no parentheses","name":"support.function.swift","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"},{"comment":"Member functions in the standard library in Swift 3","name":"support.function.swift","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*\\()"},{"comment":"Member functions in the standard library in Swift 2 only","name":"support.function.swift","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*\\()"}]},"builtin-global-functions":{"patterns":[{"begin":"\\b(type)(\\()\\s*(of)(:)","end":"\\)","beginCaptures":{"1":{"name":"support.function.dynamic-type.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"},"3":{"name":"support.variable.parameter.swift"},"4":{"name":"punctuation.separator.argument-label.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]},{"comment":"Global functions available in Swift 3 which may be used with trailing closures and no parentheses","name":"support.function.swift","match":"\\b(?:anyGenerator|autoreleasepool)(?=\\s*[({])\\b"},{"comment":"Global functions available in Swift 3","name":"support.function.swift","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*\\()"},{"comment":"Global functions available in Swift 2 only","name":"support.function.swift","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*\\()"}]},"builtin-properties":{"patterns":[{"comment":"The simpler (?<=\\bProcess\\.|\\bCommandLine\\.) breaks VS Code / Atom, see https://github.com/textmate/swift.tmbundle/issues/29","name":"support.variable.swift","match":"(?<=^Process\\.|\\WProcess\\.|^CommandLine\\.|\\WCommandLine\\.)(arguments|argc|unsafeArgv)"},{"comment":"Properties in the standard library in Swift 3","name":"support.variable.swift","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"},{"comment":"Properties in the standard library in Swift 2 only","name":"support.variable.swift","match":"(?<=\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\b"},{"comment":"Enum cases in the standard library - note that there is some overlap between these and the properties","name":"support.variable.swift","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"}]},"builtin-types":{"comment":"Types provided in the standard library","patterns":[{"include":"#builtin-types-builtin-class-type"},{"include":"#builtin-types-builtin-enum-type"},{"include":"#builtin-types-builtin-protocol-type"},{"include":"#builtin-types-builtin-struct-type"},{"include":"#builtin-types-builtin-typealias"},{"name":"support.type.any.swift","match":"\\bAny\\b"}]},"builtin-types-builtin-class-type":{"comment":"Builtin class types","name":"support.class.swift","match":"\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b"},"builtin-types-builtin-enum-type":{"patterns":[{"comment":"CommandLine is an enum, but it acts like a constant","name":"support.constant.swift","match":"\\b(?:CommandLine|Process(?=\\.))\\b"},{"comment":"The return type of a function that never returns","name":"support.constant.never.swift","match":"\\bNever\\b"},{"comment":"Enum types in the standard library in Swift 3","name":"support.type.swift","match":"\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\b"},{"comment":"Enum types in the standard library in Swift 2 only","name":"support.type.swift","match":"\\b(?:MirrorDisposition|QuickLookObject)\\b"}]},"builtin-types-builtin-protocol-type":{"patterns":[{"comment":"Protocols in the standard library in Swift 3","name":"support.type.swift","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"},{"comment":"Protocols in the standard library in Swift 2 only","name":"support.type.swift","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"}]},"builtin-types-builtin-struct-type":{"patterns":[{"comment":"Structs in the standard library in Swift 3","name":"support.type.swift","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"},{"comment":"Structs in the standard library in Swift 2 only","name":"support.type.swift","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"}]},"builtin-types-builtin-typealias":{"patterns":[{"comment":"Typealiases in the standard library in Swift 3","name":"support.type.swift","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"},{"comment":"Typealiases in the standard library in Swift 2 only","name":"support.type.swift","match":"\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\b"}]},"code-block":{"begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.section.scope.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.section.scope.end.swift"}},"patterns":[{"include":"$self"}]},"comments":{"patterns":[{"name":"comment.line.number-sign.swift","match":"\\A^(#!).*$\\n?","captures":{"1":{"name":"punctuation.definition.comment.swift"}}},{"name":"comment.block.documentation.swift","begin":"/\\*\\*(?!/)","end":"\\*/","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"patterns":[{"include":"#comments-nested"}]},{"name":"comment.block.documentation.playground.swift","begin":"/\\*:","end":"\\*/","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"patterns":[{"include":"#comments-nested"}]},{"name":"comment.block.swift","begin":"/\\*","end":"\\*/","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"patterns":[{"include":"#comments-nested"}]},{"name":"invalid.illegal.unexpected-end-of-block-comment.swift","match":"\\*/"},{"begin":"(^[ \\t]+)?(?=//)","end":"(?!\\G)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.swift"}},"patterns":[{"name":"comment.line.triple-slash.documentation.swift","begin":"///","end":"$","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}}},{"name":"comment.line.double-slash.documentation.swift","begin":"//:","end":"$","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}}},{"name":"comment.line.double-slash.swift","begin":"//","end":"$","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}}}]}]},"comments-nested":{"begin":"/\\*","end":"\\*/","patterns":[{"include":"#comments-nested"}]},"compiler-control":{"patterns":[{"contentName":"comment.block.preprocessor.swift","begin":"^\\s*(#)(if|elseif)\\s+(false)\\b.*?(?=$|//|/\\*)","end":"(?=^\\s*(#(elseif|else|endif)\\b))","beginCaptures":{"0":{"name":"meta.preprocessor.conditional.swift"},"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"name":"constant.language.boolean.swift"}}},{"name":"meta.preprocessor.conditional.swift","captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"}},"begin":"^\\s*(#)(if|elseif)\\s+","end":"(?=\\s*(?://|/\\*))|$","patterns":[{"name":"keyword.operator.logical.swift","match":"(&&|\\|\\|)"},{"name":"constant.language.boolean.swift","match":"\\b(true|false)\\b"},{"match":"\\b(arch)\\s*(\\()\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\w+)\\s*(\\))","captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.architecture.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}}},{"match":"\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))","captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.os.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}}},{"match":"\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))","captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"entity.name.type.module.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}}},{"begin":"\\b(targetEnvironment)\\s*(\\()","end":"(\\))|$","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"name":"support.constant.platform.environment.swift","match":"\\b(simulator|UIKitForMac)\\b"}]},{"begin":"\\b(swift|compiler)\\s*(\\()","end":"(\\))|$","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"name":"keyword.operator.comparison.swift","match":">=|<"},{"name":"constant.numeric.swift","match":"\\b[0-9]+(?:\\.[0-9]+)*\\b"}]}]},{"name":"meta.preprocessor.conditional.swift","match":"^\\s*(#)(else|endif)(.*?)(?=$|//|/\\*)","captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"patterns":[{"name":"invalid.illegal.character-not-allowed-here.swift","match":"\\S+"}]}}},{"name":"meta.preprocessor.sourcelocation.swift","match":"^\\s*(#)(sourceLocation)((\\()([^)]*)(\\)))(.*?)(?=$|//|/\\*)","captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.sourcelocation.swift"},"4":{"name":"punctuation.definition.parameters.begin.swift"},"5":{"patterns":[{"begin":"(file)\\s*(:)\\s*(?=\")","end":"(?!\\G)","beginCaptures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"patterns":[{"include":"#literals"}]},{"match":"(line)\\s*(:)\\s*([0-9]+)","captures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"},"3":{"name":"constant.numeric.integer.swift"}}},{"name":"punctuation.separator.parameters.swift","match":","},{"name":"invalid.illegal.character-not-allowed-here.swift","match":"\\S+"}]},"6":{"name":"punctuation.definition.parameters.begin.swift"},"7":{"patterns":[{"name":"invalid.illegal.character-not-allowed-here.swift","match":"\\S+"}]}}}]},"conditionals":{"patterns":[{"begin":"(?<!\\.)\\b(if|guard|switch|for)\\b","end":"(?=\\{)","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"patterns":[{"include":"#expressions-without-trailing-closures"}]},{"comment":"while can be the end of a repeat-while statement so doesn't necessarily have braces after it","begin":"(?<!\\.)\\b(while)\\b","end":"(?=\\{)|$","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"patterns":[{"include":"#expressions-without-trailing-closures"}]}]},"declarations":{"patterns":[{"include":"#declarations-function"},{"include":"#declarations-function-initializer"},{"include":"#declarations-function-subscript"},{"include":"#declarations-typed-variable-declaration"},{"include":"#declarations-import"},{"include":"#declarations-operator"},{"include":"#declarations-precedencegroup"},{"include":"#declarations-protocol"},{"include":"#declarations-type"},{"include":"#declarations-extension"},{"include":"#declarations-typealias"},{"include":"#declarations-macro"}]},"declarations-available-types":{"patterns":[{"include":"#comments"},{"include":"#builtin-types"},{"include":"#attributes"},{"name":"storage.modifier.async.swift","match":"\\basync\\b"},{"name":"storage.modifier.exception.swift","match":"\\b(?:throws|rethrows)\\b"},{"name":"keyword.other.operator.type.opaque.swift","match":"\\bsome\\b"},{"name":"keyword.other.operator.type.existential.swift","match":"\\bany\\b"},{"name":"keyword.control.loop.swift","match":"\\b(?:repeat|each)\\b"},{"name":"storage.modifier.swift","match":"\\b(?:inout|isolated|borrowing|consuming)\\b"},{"name":"variable.language.swift","match":"\\bSelf\\b"},{"match":"(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])","captures":{"1":{"name":"keyword.operator.type.function.swift"}}},{"comment":"Swift 3: A & B","match":"(?<![/=\\-+!*%<>&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])","captures":{"1":{"name":"keyword.operator.type.composition.swift"}}},{"name":"keyword.operator.type.optional.swift","match":"[?!]"},{"name":"keyword.operator.function.variadic-parameter.swift","match":"\\.\\.\\."},{"comment":"Swift 2: protocol<A, B>","name":"keyword.other.type.composition.swift","match":"\\bprotocol\\b"},{"name":"keyword.other.type.metatype.swift","match":"(?<=\\.)(?:Protocol|Type)\\b"},{"include":"#declarations-available-types-tuple-type"},{"include":"#declarations-available-types-collection-type"},{"include":"#declarations-generic-argument-clause"}]},"declarations-available-types-collection-type":{"comment":"array and dictionary types [Value] and [Key: Value]","begin":"\\[","end":"\\]|(?=[>){}])","beginCaptures":{"0":{"name":"punctuation.section.collection-type.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.section.collection-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"},{"begin":":","end":"(?=\\]|[>){}])","beginCaptures":{"0":{"name":"punctuation.separator.key-value.swift"}},"patterns":[{"name":"invalid.illegal.extra-colon-in-dictionary-type.swift","match":":"},{"include":"#declarations-available-types"}]}]},"declarations-available-types-tuple-type":{"begin":"\\(","end":"\\)|(?=[>\\]{}])","beginCaptures":{"0":{"name":"punctuation.section.tuple-type.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.section.tuple-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"}]},"declarations-extension":{"name":"meta.definition.type.$1.swift","begin":"\\b(extension)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))","end":"(?<=\\})","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.swift","patterns":[{"include":"#declarations-available-types"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"comment":"SE-0143: Conditional Conformances","include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"name":"meta.definition.type.body.swift","begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-function":{"name":"meta.definition.function.swift","begin":"(?x)\n\\b\n(func)\n\\s+\n(\n (?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n | (?:\n (\n (?<oph> # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g<oph>\n | (?<opc> # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ ) # Dot operators\n )\n)\n\\s*\n(?=\\(|<)","end":"(?<=\\})|$(?# functions in protocol declarations or generated interfaces have no body)","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"comment":"Swift 3: generic constraints after the parameters and return type","include":"#declarations-generic-where-clause"},{"name":"meta.definition.function.body.swift","begin":"(\\{)","end":"(\\})","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-function-initializer":{"name":"meta.definition.function.initializer.swift","begin":"(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)","end":"(?<=\\})|$","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"name":"invalid.illegal.character-not-allowed-here.swift","match":"(?<=[?!])[?!]+"}]}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"comment":"Swift 3: generic constraints after the parameters and return type","include":"#declarations-generic-where-clause"},{"name":"meta.definition.function.body.swift","begin":"(\\{)","end":"(\\})","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-function-result":{"name":"meta.function-result.swift","begin":"(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])\\s*","end":"(?!\\G)(?=\\{|\\bwhere\\b|;|=)|$","beginCaptures":{"1":{"name":"keyword.operator.function-result.swift"}},"patterns":[{"include":"#declarations-available-types"}]},"declarations-function-subscript":{"name":"meta.definition.function.subscript.swift","begin":"(?<!\\.)\\b(subscript)\\s*(?=\\(|<)","end":"(?<=\\})|$","beginCaptures":{"1":{"name":"storage.type.function.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"name":"meta.definition.function.body.swift","begin":"(\\{)","end":"(\\})","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-generic-argument-clause":{"name":"meta.generic-argument-clause.swift","begin":"<","end":">|(?=[)\\]{}])","beginCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.end.swift"}},"patterns":[{"include":"#declarations-available-types"}]},"declarations-generic-parameter-clause":{"name":"meta.generic-parameter-clause.swift","begin":"<","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.)","beginCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.end.swift"}},"patterns":[{"include":"#comments"},{"comment":"Swift 2: constraints inside the generic param list","include":"#declarations-generic-where-clause"},{"name":"keyword.control.loop.swift","match":"\\beach\\b"},{"match":"\\b((?!\\d)\\w[\\w\\d]*)\\b","captures":{"1":{"name":"variable.language.generic-parameter.swift"}}},{"name":"punctuation.separator.generic-parameters.swift","match":","},{"name":"meta.generic-parameter-constraint.swift","begin":"(:)\\s*","end":"(?=[,>]|(?!\\G)\\bwhere\\b)","beginCaptures":{"1":{"name":"punctuation.separator.generic-parameter-constraint.swift"}},"patterns":[{"name":"entity.other.inherited-class.swift","begin":"\\G","end":"(?=[,>]|(?!\\G)\\bwhere\\b)","patterns":[{"include":"#declarations-type-identifier"},{"include":"#declarations-type-operators"}]}]}]},"declarations-generic-where-clause":{"name":"meta.generic-where-clause.swift","begin":"\\b(where)\\b\\s*","end":"(?!\\G)$|(?=[>{};\\n]|//|/\\*)","beginCaptures":{"1":{"name":"keyword.other.generic-constraint-introducer.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-where-clause-requirement-list"}]},"declarations-generic-where-clause-requirement-list":{"begin":"\\G|,\\s*","end":"(?=[,>{};\\n]|//|/\\*)","patterns":[{"include":"#comments"},{"include":"#constraint"},{"include":"#declarations-available-types"},{"name":"meta.generic-where-clause.same-type-requirement.swift","begin":"(?<![/=\\-+!*%<>&|\\^~.])(==)(?![/=\\-+!*%<>&|\\^~.])","end":"(?=\\s*[,>{};\\n]|//|/\\*)","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.same-type.swift"}},"patterns":[{"include":"#declarations-available-types"}]},{"name":"meta.generic-where-clause.conformance-requirement.swift","begin":"(?<![/=\\-+!*%<>&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])","end":"(?=\\s*[,>{};\\n]|//|/\\*)","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.conforms-to.swift"}},"patterns":[{"contentName":"entity.other.inherited-class.swift","begin":"\\G\\s*","end":"(?=\\s*[,>{};\\n]|//|/\\*)","patterns":[{"include":"#declarations-available-types"}]}]}]},"declarations-import":{"name":"meta.import.swift","begin":"(?<!\\.)\\b(import)\\s+","end":"(;)|$\\n?|(?=//|/\\*)","beginCaptures":{"1":{"name":"keyword.control.import.swift"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"patterns":[{"begin":"\\G(?!;|$|//|/\\*)(?:(typealias|struct|class|actor|enum|protocol|var|func)\\s+)?","end":"(?=;|$|//|/\\*)","beginCaptures":{"1":{"name":"storage.modifier.swift"}},"patterns":[{"name":"entity.name.type.swift","match":"(?x)\n(?<=\\G|\\.)\n(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)","captures":{"1":{"name":"punctuation.definition.identifier.swift"},"2":{"name":"punctuation.definition.identifier.swift"}}},{"name":"entity.name.type.swift","match":"(?x)\n(?<=\\G|\\.)\n\\$[0-9]+"},{"name":"entity.name.type.swift","match":"(?x)\n(?<=\\G|\\.)\n(?:\n (\n (?<oph> # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g<oph>\n | (?<opc> # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ ) # Dot operators\n)\n(?=\\.|;|$|//|/\\*|\\s)","captures":{"1":{"patterns":[{"name":"invalid.illegal.dot-not-allowed-here.swift","match":"\\."}]}}},{"name":"punctuation.separator.import.swift","match":"\\."},{"name":"invalid.illegal.character-not-allowed-here.swift","begin":"(?!\\s*(;|$|//|/\\*))","end":"(?=\\s*(;|$|//|/\\*))"}]}]},"declarations-inheritance-clause":{"name":"meta.inheritance-clause.swift","begin":"(:)(?=\\s*\\{)|(:)\\s*","end":"(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)","beginCaptures":{"1":{"name":"invalid.illegal.empty-inheritance-clause.swift"},"2":{"name":"punctuation.separator.inheritance-clause.swift"}},"patterns":[{"begin":"\\bclass\\b","end":"(?=[={}]|(?!\\G)\\bwhere\\b)","beginCaptures":{"0":{"name":"storage.type.class.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause-more-types"}]},{"begin":"\\G","end":"(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]}]},"declarations-inheritance-clause-inherited-type":{"name":"entity.other.inherited-class.swift","begin":"(?=[`\\p{L}_])","end":"(?!\\G)","patterns":[{"include":"#declarations-type-identifier"}]},"declarations-inheritance-clause-more-types":{"name":"meta.inheritance-list.more-types","begin":",\\s*","end":"(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]},"declarations-macro":{"name":"meta.definition.macro.swift","begin":"(?x)\n\\b\n(macro)\n\\s+\n((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\n\\s*\n(?=\\(|<|=)","end":"$|(?=;|//|/\\*|\\}|=)","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"comment":"Swift 3: generic constraints after the parameters and return type","include":"#declarations-generic-where-clause"}]},"declarations-operator":{"name":"meta.definition.operator.swift","begin":"(?x)\n(?:\n \\b(prefix|infix|postfix)\n \\s+\n)?\n\\b\n(operator)\n\\s+\n(\n (\n (?<oph> # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g<oph>\n | \\. # Invalid dot\n | (?<opc> # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*+\n )\n | ( \\. ( \\g<oph> | \\g<opc> | \\. )++ ) # Dot operators\n)\n\\s*","end":"(;)|$\\n?|(?=//|/\\*)","beginCaptures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"storage.type.function.operator.swift"},"3":{"name":"entity.name.function.operator.swift"},"4":{"comment":"workaround for https://github.com/microsoft/vscode-textmate/issues/140#issuecomment-1793610346","name":"entity.name.function.operator.swift","patterns":[{"name":"invalid.illegal.dot-not-allowed-here.swift","match":"\\."}]}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"patterns":[{"include":"#declarations-operator-swift2"},{"include":"#declarations-operator-swift3"},{"name":"invalid.illegal.character-not-allowed-here.swift","match":"((?!$|;|//|/\\*)\\S)+"}]},"declarations-operator-swift2":{"begin":"\\G(\\{)","end":"(\\})","beginCaptures":{"1":{"name":"punctuation.definition.operator.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.definition.operator.end.swift"}},"patterns":[{"include":"#comments"},{"match":"\\b(associativity)\\s+(left|right)\\b","captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}}},{"match":"\\b(precedence)\\s+([0-9]+)\\b","captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.numeric.integer.swift"}}},{"match":"\\b(assignment)\\b","captures":{"1":{"name":"storage.modifier.swift"}}}]},"declarations-operator-swift3":{"match":"\\G(:)\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))","captures":{"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}}},"declarations-parameter-clause":{"name":"meta.parameter-clause.swift","begin":"(\\()","end":"(\\))(?:\\s*(async)\\b)?","beginCaptures":{"1":{"name":"punctuation.definition.parameters.begin.swift"}},"endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"},"2":{"name":"storage.modifier.async.swift"}},"patterns":[{"include":"#declarations-parameter-list"}]},"declarations-parameter-list":{"patterns":[{"comment":"External parameter labels are considered part of the function name","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*:)","captures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"variable.parameter.function.swift"},"5":{"name":"punctuation.definition.identifier.swift"},"6":{"name":"punctuation.definition.identifier.swift"}}},{"comment":"If no external label is given, the name is both the external label and the internal variable name","match":"(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)))(?=\\s*:)","captures":{"1":{"name":"variable.parameter.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}}},{"begin":":\\s*(?!\\s)","end":"(?=[,)])","patterns":[{"include":"#declarations-available-types"},{"name":"invalid.illegal.extra-colon-in-parameter-list.swift","match":":"},{"comment":"a parameter's default value","begin":"=","end":"(?=[,)])","beginCaptures":{"0":{"name":"keyword.operator.assignment.swift"}},"patterns":[{"include":"#expressions"}]}]}]},"declarations-precedencegroup":{"name":"meta.definition.precedencegroup.swift","begin":"\\b(precedencegroup)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(?=\\{)","end":"(?!\\G)","beginCaptures":{"1":{"name":"storage.type.precedencegroup.swift"},"2":{"name":"entity.name.type.precedencegroup.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.definition.precedencegroup.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.precedencegroup.end.swift"}},"patterns":[{"include":"#comments"},{"match":"\\b(higherThan|lowerThan)\\s*:\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))","captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}}},{"match":"\\b(associativity)\\b(?:\\s*:\\s*(right|left|none)\\b)?","captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}}},{"match":"\\b(assignment)\\b(?:\\s*:\\s*(true|false)\\b)?","captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.language.boolean.swift"}}}]}]},"declarations-protocol":{"name":"meta.definition.type.protocol.swift","begin":"\\b(protocol)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))","end":"(?<=\\})","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause"},{"comment":"SE-0142: Permit where clauses to constrain associated types","include":"#declarations-generic-where-clause"},{"name":"meta.definition.type.body.swift","begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"patterns":[{"include":"#declarations-protocol-protocol-method"},{"include":"#declarations-protocol-protocol-initializer"},{"include":"#declarations-protocol-associated-type"},{"include":"$self"}]}]},"declarations-protocol-associated-type":{"name":"meta.definition.associatedtype.swift","begin":"\\b(associatedtype)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*","end":"(?!\\G)$|(?=[;}]|$)","beginCaptures":{"1":{"name":"keyword.other.declaration-specifier.swift"},"2":{"name":"variable.language.associatedtype.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#declarations-inheritance-clause"},{"comment":"SE-0142: Permit where clauses to constrain associated types","include":"#declarations-generic-where-clause"},{"include":"#declarations-typealias-assignment"}]},"declarations-protocol-protocol-initializer":{"name":"meta.definition.function.initializer.swift","begin":"(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)","end":"$|(?=;|//|/\\*|\\})","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"name":"invalid.illegal.character-not-allowed-here.swift","match":"(?<=[?!])[?!]+"}]}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"comment":"Swift 3: generic constraints after the parameters and return type","include":"#declarations-generic-where-clause"},{"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-protocol-protocol-method":{"name":"meta.definition.function.swift","begin":"(?x)\n\\b\n(func)\n\\s+\n(\n (?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n | (?:\n (\n (?<oph> # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g<oph>\n | (?<opc> # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ ) # Dot operators\n )\n )\n\\s*\n(?=\\(|<)","end":"$|(?=;|//|/\\*|\\})","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"comment":"Swift 3: generic constraints after the parameters and return type","include":"#declarations-generic-where-clause"},{"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"patterns":[{"include":"$self"}]}]},"declarations-type":{"patterns":[{"name":"meta.definition.type.$1.swift","begin":"\\b(class(?!\\s+(?:func|var|let)\\b)|struct|actor)\\b\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))","end":"(?<=\\})","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"comment":"Swift 3: generic constraints after the generic param list","include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"name":"meta.definition.type.body.swift","begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"patterns":[{"include":"$self"}]}]},{"include":"#declarations-type-enum"}]},"declarations-type-enum":{"name":"meta.definition.type.$1.swift","begin":"\\b(enum)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]