{ "fileTypes": [ "swift" ], "firstLineMatch": "^#!/.*\\bswift", "keyEquivalent": "^~S", "name": "Swift", "patterns": [ { "include": "#shebang-line" }, { "include": "#comment" }, { "include": "#attribute" }, { "include": "#literal" }, { "include": "#operator" }, { "include": "#declaration" }, { "include": "#storage-type" }, { "include": "#keyword" }, { "include": "#type" }, { "include": "#builtin-global-function" }, { "include": "#builtin-function" }, { "include": "#builtin-property" }, { "include": "#builtin-static-property" }, { "include": "#builtin-constant" }, { "include": "#section-punctuation" } ], "repository": { "arithmetic-operator": { "match": "(?&|\\^~.])(\\+|\\-|\\*|\\/)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.arithmetic.swift" }, "array-type": { "begin": "\\b(Array)(\\[)", "beginCaptures": { "1": { "name": "support.type.array.swift" }, "2": { "name": "punctuation.definition.array.begin.swift" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.array.end.swift" } }, "name": "meta.array.swift", "patterns": [ { "include": "$self" } ] }, "assignment-operator": { "match": "(?&|\\^~.])(\\+|\\-|\\*|\\/|%|<<|>>|&|\\^|\\||&&|\\|\\|)?=(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.assignment.swift" }, "attribute": { "comment": "attribute", "name": "meta.attribute.swift", "patterns": [ { "begin": "((@)(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B))(\\()", "beginCaptures": { "1": { "name": "storage.modifier.attribute.swift" }, "2": { "name": "punctuation.definition.attribute.swift" }, "3": { "name": "punctuation.definition.attribute-arguments.begin.swift" } }, "contentName": "meta.attribute.arguments.swift", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.attribute-arguments.end.swift" } }, "patterns": [ { "include": "$self" } ] }, { "captures": { "1": { "name": "storage.modifier.attribute.swift" }, "2": { "name": "punctuation.definition.attribute.swift" } }, "match": "((@)(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B))" } ] }, "bitwise-operator": { "match": "(?&|\\^~.])(&|\\||\\^|<<|>>)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.bitwise.swift" }, "boolean-literal": { "match": "\\b(true|false)\\b", "name": "constant.language.boolean.swift" }, "branch-statement-keyword": { "name": "keyword.control.branch.swift", "patterns": [ { "include": "#if-statement-keyword" }, { "include": "#switch-statement-keyword" } ] }, "builtin-class-type": { "comment": "Builtin class types", "match": "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b", "name": "support.class.swift" }, "builtin-constant": { "comment": "Process is really an enum, but it acts like a constant", "match": "\\bProcess\\b", "name": "support.constant.swift" }, "builtin-enum-type": { "comment": "Builtin enum types", "match": "\\b(MirrorDisposition|Bit|ImplicitlyUnwrappedOptional|Optional|UnicodeDecodingResult|QuickLookObject|FloatingPointClassification)\\b", "name": "support.type.swift" }, "builtin-function": { "comment": "Functions provided in the standard library; found by searching ^[ \\t]+func\\s+(\\w+?)[<(]", "match": "(?<=\\.)(s(tartsWith|ort|u(ccessor|perclassMirror|btract)|amePositionIn)|has(Suffix|Prefix)|next(Object)?|c(haracterAtIndex|o(ntains|untByEnumeratingWithState|pyWithZone)|ustom(Mirror|PlaygroundQuickLook)|lamp)|t(o(IntMax|Opaque|UIntMax)|ake(RetainedValue|UnretainedValue))|i(s(S(trictSu(persetOf|bsetOf)|u(persetOf|bsetOf))|DisjointWith|EmptyInput|ASCII)|n(tersect|itialize(From)?|dex(Of|ForKey)))|object(Enumerator|ForKey|AtIndex)|d(istanceTo|e(s(cendant|troy)|alloc))|un(ion|derestimateCount)|join|p(ut|redecessor)|e(scape|numerate|lementsEqual|xclusiveOr)|keyEnumerator|f(ilter|latMap)|w(ith(CString|U(nsafe(MutablePointer(s|To(Elements|Value))|BufferPointer)|TF8Buffer))|riteTo)|le(ngth|xicographicalCompare)|a(ssign(BackwardFrom|From)|dvancedBy|utorelease)|re(tain|duce|verse|questNativeBuffer|lease)|ge(nerate|t(Mirror|Objects))|m(inElement|ove(Initialize(BackwardFrom|From)|AssignFrom)?|ember|a(p|xElement)))\\b", "name": "support.function.swift" }, "builtin-global-function": { "comment": "Global functions provided in the standard library; found by searching ^func\\s+(\\w+?)[<(]", "match": "\\b(s(tride(of(Value)?)?|izeof(Value)?|ort|uffix|pli(ce|t)|wap)|numericCast|transcode|i(sUniquelyReferenced(NonObjC)?|nsert)|zip|overlaps|d(istance|ump|ebugPrint|rop(First|Last))|unsafe(BitCast|Downcast|Unwrap|AddressOf)|join|pr(int|e(condition|fix))|extend|with(Unsafe(MutablePointer(s)?|Pointer(s)?)|ExtendedLifetime|VaList)|lazy|a(ssert(ionFailure)?|nyGenerator|dvance|lignof(Value)?|bs)|re(flect|adLine|move(Range|Last|A(tIndex|ll)))|getVaList|m(in|ax))\\b", "name": "support.function.swift" }, "builtin-property": { "comment": "Properties provided in the standard library; found by searching ^\\s+var\\s+(\\w+?)\\W", "match": "(?<=\\.)(s(t(art(Index)?|ringValue)|ummary)|has(hValue|PointerRepresentation)|nulTerminatedUTF8|c(haracters|ount|apacity)|i(s(S(ign(Minus|aling)|ubnormal)|N(ormal|aN)|Infinite|Zero|Empty|Finite|ASCII)|ndices|dentity)|o(wner|bjectIdentifier)|d(isposition|e(scription|bugDescription))|u(nicodeScalar(s)?|tf(16|8(Start)?)|intValue|ppercaseString)|end(Index)?|value(s|Type)?|keys|quickLookObject|f(irst|loatingPointClass)|l(ittleEndian|owercaseString|ast)|a(llocatedElementCount|rray)|rawValue|memory|b(yteS(ize|wapped)|igEndian|oolValue|uffer|aseAddress))\\b", "name": "support.variable.swift" }, "builtin-protocol-type": { "comment": "Builtin protocol types", "match": "\\b(Ra(n(domAccessIndexType|geReplaceableCollectionType)|wRepresentable)|GeneratorType|M(irror(Type|PathType)|utable(Sliceable|CollectionType))|B(i(twiseOperationsType|directionalIndexType)|oolean(Type|LiteralConvertible))|S(tr(i(ng(InterpolationConvertible|LiteralConvertible)|deable)|eamable)|i(nkType|gned(NumberType|IntegerType))|e(tAlgebraType|quenceType)|liceable)|Hashable|NilLiteralConvertible|C(o(llectionType|mparable)|ustom(Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArgType)|Inte(rvalType|ger(Type|LiteralConvertible|ArithmeticType))|O(utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(signedIntegerType|icode(ScalarLiteralConvertible|CodecType))|E(quatable|rrorType|xten(sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(orwardIndexType|loat(ingPointType|LiteralConvertible))|A(ny(CollectionType|Object)|rrayLiteralConvertible|bsoluteValuable))\\b", "name": "support.type.swift" }, "builtin-static-property": { "comment": "Static properties provided in the standard library; found by searching ^\\s*(class|static)\\s+var\\s+(\\w+?)\\W", "match": "(?<=\\.)(infinity|NaN|quietNaN|allZeros|m(in|ax))\\b|(?<=\\bProcess\\.)(arguments|argc|unsafeArgv)\\b", "name": "support.variable.swift" }, "builtin-struct-type": { "comment": "Builtin struct types", "match": "\\b(R(e(peat|verse(RandomAccess(Collection|Index)|Collection|Index))|a(nge(Generator)?|wByte))|Generator(Sequence|OfOne)|M(irror|a(nagedBufferPointer|p(Generator|Sequence|Collection)))|Bool|S(t(aticString|ri(ng|deT(hrough(Generator)?|o(Generator)?)))|inkOf|et(Generator|Index)?)|HalfOpenInterval|C(haracter|o(ntiguousArray|llectionOfOne)|OpaquePointer|losedInterval|VaListPointer)|In(t(16|8|32|64)?|dexingGenerator)|Zip2(Generator|Sequence)|ObjectIdentifier|D(ictionary(Generator|Index|Literal)?|ouble)|U(n(safe(Mutable(BufferPointer|Pointer)|BufferPointer(Generator)?|Pointer)|icodeScalar|managed)|TF(16|8|32)|Int(16|8|32|64)?)|PermutationGenerator|E(numerate(Generator|Sequence)|mpty(Generator|Collection))|F(ilter(Generator|Sequence|Collection(Index)?)|loat(80)?)|Lazy(RandomAccessCollection|BidirectionalCollection|Sequence|ForwardCollection)|A(ny(RandomAccess(Collection|Index)|Bidirectional(Collection|Index)|Sequence|Forward(Collection|Index))|utoreleasingUnsafeMutablePointer|rray(Slice)?))\\b", "name": "support.type.swift" }, "builtin-type": { "comment": "Types provided in the standard library; found by searching ^(@objc\\s+)?(struct|protocol|class|enum)\\s+(\\w+)[\\s<].+$", "patterns": [ { "include": "#builtin-class-type" }, { "include": "#builtin-enum-type" }, { "include": "#builtin-protocol-type" }, { "include": "#builtin-struct-type" }, { "include": "#builtin-typealias" } ] }, "builtin-typealias": { "comment": "Builtin typealiases", "match": "\\b(BooleanLiteralType|StringLiteralType|C(Bool|S(hort|ignedChar)|Char(16|32)?|Int|Double|Unsigned(Short|Char|Int|Long(Long)?)|Float|WideChar|Long(Long)?)|Int(Max|egerLiteralType)|U(nicodeScalarType|IntMax|Word)|PlaygroundQuickLook|ExtendedGraphemeClusterType|Void|Float(32|LiteralType|64)|Word|Any(Class)?)\\b", "name": "support.type.swift" }, "capture-specifier": { "comment": "matches weak, unowned, unowned(safe), unowned(unsafe)", "match": "\\b(weak|unowned(?:\\((?:un)?safe\\))?)", "name": "keyword.other.capture-specifier.swift" }, "coalescing-operator": { "match": "(?&|\\^~.])\\?\\?(?![?/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.coalescing.swift" }, "code-block": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.code-block.begin.swift" } }, "comment": "code-block", "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.definition.code-block.end.swift" } }, "patterns": [ { "include": "$self" } ] }, "collection-type": { "comment": "Collection types", "patterns": [ { "include": "#array-type" }, { "include": "#dictionary-type" } ] }, "comment": { "comment": "All comment types", "patterns": [ { "include": "#block-doc" }, { "include": "#block" }, { "include": "#inline-doc" }, { "include": "#inline" } ], "repository": { "block": { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.begin.swift" } }, "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.block.end.swift" } }, "name": "comment.block.swift", "patterns": [ { "include": "#nested" } ], "repository": { "nested": { "begin": "/\\*", "end": "\\*/", "patterns": [ { "include": "#nested" } ] } } }, "block-doc": { "begin": "/\\*\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.documentation.begin.swift" } }, "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.block.documentation.end.swift" } }, "name": "comment.block.documentation.swift", "patterns": [ { "include": "#nested" }, { "include": "text.restructuredtext#tags" } ], "repository": { "nested": { "begin": "/\\*", "end": "\\*/", "patterns": [ { "include": "#nested" }, { "include": "text.restructuredtext#tags" } ] } } }, "inline": { "begin": "(^[ \\t]+)?(?=//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.swift" } }, "end": "(?!\\G)", "patterns": [ { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.swift" } }, "end": "\\n", "name": "comment.line.double-slash.swift" } ] }, "inline-doc": { "begin": "(^[ \\t]+)?(?=///)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.swift" } }, "end": "(?!\\G)", "patterns": [ { "begin": "///", "beginCaptures": { "0": { "name": "punctuation.definition.comment.swift" } }, "end": "\\n", "name": "comment.line.triple-slash.swift" } ] } } }, "comparative-operator": { "match": "(?&|\\^~.])((=|!)==?|(<|>)=?|~=)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.comparative.swift" }, "control-transfer-statement-keyword": { "comment": "control-transfer-statement", "match": "\\b(continue|break|fallthrough|return)\\b", "name": "keyword.control.transfer.swift" }, "custom-operator": { "patterns": [ { "match": "(?<=[\\s(\\[{,;:])([/=\\-+!*%<>&|\\^~.]++)(?![\\s)\\]},;:])", "name": "keyword.operator.custom.prefix.unary.swift" }, { "match": "(?&|\\^~.]++)(?![\\s)\\]},;:\\.])", "name": "keyword.operator.custom.postfix.unary.swift" }, { "match": "(?<=[\\s(\\[{,;:])([/=\\-+!*%<>&|\\^~.]++)(?=[\\s)\\]},;:])", "name": "keyword.operator.custom.binary.swift" } ] }, "declaration": { "comment": "declaration", "name": "meta.declaration.swift", "patterns": [ { "include": "#import-declaration" }, { "include": "#function-declaration" } ] }, "declaration-specifier": { "comment": "declaration-specifier", "match": "\\b(class|deinit|enum|extension|func|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b", "name": "keyword.other.declaration-specifier.swift" }, "dictionary-type": { "begin": "\\b(Dictionary)(\\[)", "beginCaptures": { "1": { "name": "support.type.dictionary.swift" }, "2": { "name": "punctuation.definition.dictionary.begin.swift" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.dictionary.end.swift" } }, "name": "meta.dictionary.swift", "patterns": [ { "include": "$self" } ] }, "floating-point-literal": { "name": "constant.numeric.floating-point.swift", "patterns": [ { "comment": "floating-point-literal -> (decimal-literal)(decimal-fraction)?(decimal-exponent)?", "match": "\\b([0-9][0-9_]*)(\\.([0-9][0-9_]*))?([eE][+\\-]?([0-9][0-9_]*))?\\b" }, { "comment": "floating-point-literal -> (hexadecimal-literal)(hexadecimal-fraction)?(hexadecimal-exponent)", "match": "\\b(0x\\h[\\h_]*)(\\.(0x\\h[\\h_]*))?([pP][+\\-]?(0x\\h[\\h_]*))\\b" } ] }, "function-declaration": { "begin": "\\b(func)\\s+(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+)\\s*(?=\\(|<)", "beginCaptures": { "1": { "name": "storage.type.function.swift" }, "2": { "name": "entity.name.function.swift" } }, "comment": "function-declaration", "end": "(?<=\\})|$", "name": "meta.function-declaration.swift", "patterns": [ { "include": "#generic-parameter-clause" }, { "include": "#parameter-clause" }, { "include": "#function-result" }, { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.section.function.begin.swift" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.function.end.swift" } }, "name": "meta.function-declaration.body.swift", "patterns": [ { "include": "$self" } ] } ] }, "function-result": { "begin": "(?&|\\^~.])(\\->)(?![/=\\-+!*%<>&|\\^~.])\\s*", "beginCaptures": { "1": { "name": "keyword.operator.function-result.swift" } }, "comment": "function-result", "end": "(?=\\{)|$", "name": "meta.function-result.swift", "patterns": [ { "include": "#type" } ] }, "generic-parameter-clause": { "begin": "(<)", "beginCaptures": { "1": { "name": "punctuation.definition.generic-parameter-clause.begin.swift" } }, "comment": "generic-parameter-clause", "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.generic-parameter-clause.end.swift" } }, "name": "meta.generic-parameter-clause.swift", "patterns": [ { "include": "$self" } ] }, "identifier": { "comment": "identifier", "match": "(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B)", "name": "meta.identifier.swift" }, "if-statement-keyword": { "comment": "if-statement", "match": "\\b(if|else)\\b", "name": "keyword.control.if.swift" }, "import-declaration": { "captures": { "1": { "name": "keyword.other.import.swift" }, "2": { "name": "storage.modifier.swift" }, "3": { "name": "support.type.module.import.swift" } }, "comment": "import-declaration", "match": "\\b(import)\\s+(?:(typealias|struct|class|enum|protocol|var|func)\\s+)?((?:\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+)(?:\\.(?:\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+))*)", "name": "meta.import.swift" }, "increment-decrement-operator": { "match": "(?&|\\^~.])(\\+\\+|\\-\\-)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.increment-or-decrement.swift" }, "integer-literal": { "name": "constant.numeric.integer.swift", "patterns": [ { "comment": "binary-literal", "match": "(\\B\\-|\\b)(0b[01][01_]*)\\b", "name": "constant.numeric.integer.binary.swift" }, { "comment": "octal-literal", "match": "(\\B\\-|\\b)(0o[0-7][0-7_]*)\\b", "name": "constant.numeric.integer.octal.swift" }, { "comment": "decimal-literal", "match": "(\\B\\-|\\b)([0-9][0-9_]*)\\b", "name": "constant.numeric.integer.decimal.swift" }, { "comment": "hexadecimal-literal", "match": "(\\B\\-|\\b)(0x\\h[\\h_]*)\\b", "name": "constant.numeric.integer.hexadecimal.swift" } ] }, "keyword": { "patterns": [ { "include": "#branch-statement-keyword" }, { "include": "#control-transfer-statement-keyword" }, { "include": "#loop-statement-keyword" }, { "include": "#declaration-specifier" }, { "include": "#capture-specifier" }, { "include": "#operator-declaration-keyword" }, { "comment": "declaration keyword", "match": "\\b(class|deinit|enum|extension|func|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b", "name": "storage.type.declaration.swift" }, { "comment": "statement keyword", "match": "\\b(break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while)\\b", "name": "keyword.control.statement.swift" }, { "comment": "expression and type keyword", "match": "\\b(as|catch|dynamicType|false|is|nil|rethrows|super|self|Self|throw|throws|true|try|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\\b", "name": "keyword.other.statement.swift" }, { "comment": "other keyword", "match": "\\b(associativity|convenience|dynamic|didSet|final|get|infix|indirect|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet)\\b", "name": "keyword.other.swift" } ] }, "literal": { "patterns": [ { "include": "#integer-literal" }, { "include": "#floating-point-literal" }, { "include": "#string-literal" }, { "include": "#special-literal" }, { "include": "#boolean-literal" }, { "include": "#nil-literal" } ] }, "logical-operator": { "match": "(?&|\\^~.])(!|&&|\\|\\|)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.logical.swift" }, "loop-statement-keyword": { "comment": "loop-statement", "match": "\\b(while|do|for|in)\\b", "name": "keyword.control.loop.swift" }, "nil-literal": { "match": "\\bnil\\b", "name": "constant.language.nil.swift" }, "operator": { "patterns": [ { "include": "#comparative-operator" }, { "include": "#assignment-operator" }, { "include": "#logical-operator" }, { "include": "#remainder-operator" }, { "include": "#increment-decrement-operator" }, { "include": "#overflow-operator" }, { "include": "#range-operator" }, { "include": "#bitwise-operator" }, { "include": "#arithmetic-operator" }, { "include": "#ternary-operator" }, { "include": "#type-casting-operator" }, { "include": "#coalescing-operator" }, { "include": "#custom-operator" } ] }, "operator-declaration-keyword": { "comment": "operator-declaration", "match": "\\b(operator|prefix|infix|postfix)\\b", "name": "keyword.other.operator.swift" }, "optional-type": { "beginCaptures": { "1": { "name": "support.type.optional.swift" }, "2": { "name": "punctuation.definition.optional.begin.swift" } }, "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.optional.end.swift" } }, "match": "\\b(Optional)(<)", "name": "meta.optional.swift", "patterns": [ { "include": "$self" } ] }, "overflow-operator": { "match": "(?&|\\^~.])\\&(\\+|\\-|\\*|\\/|%)(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.overflow.swift" }, "parameter-clause": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.function-arguments.begin.swift" } }, "comment": "parameter-clause", "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.function-arguments.end.swift" } }, "name": "meta.parameter-clause.swift", "patterns": [ { "captures": { "1": { "name": "entity.name.function.swift" }, "2": { "name": "variable.parameter.function.swift" } }, "comment": "named parameters", "match": "\\b([\\w^\\d][\\w\\d]*)\\b\\s+\\b([\\w^\\d][\\w\\d]*)\\b" }, { "include": "$self" } ] }, "protocol-composition-type": { "beginCaptures": { "1": { "name": "support.type.protocol.swift" }, "2": { "name": "punctuation.definition.protocol.begin.swift" } }, "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.protocol.end.swift" } }, "match": "\\b(protocol)(<)", "name": "meta.protocol.swift", "patterns": [ { "include": "$self" } ] }, "range-operator": { "match": "(?&|\\^~.])\\.\\.[.<]?(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.range.swift" }, "remainder-operator": { "match": "(?&|\\^~.])\\%(?![/=\\-+!*%<>&|\\^~.])", "name": "keyword.operator.remainder.swift" }, "section-punctuation": { "patterns": [ { "captures": { "1": { "name": "punctuation.section.scope.begin.swift" }, "2": { "name": "punctuation.section.scope.end.swift" } }, "comment": "Allows the special return snippet to fire.", "match": "(\\{)(\\})" }, { "captures": { "1": { "name": "punctuation.section.scope.begin.swift" }, "2": { "name": "punctuation.section.scope.end.swift" } }, "comment": "Allows the special return snippet to fire.", "match": "(\\()(\\))" }, { "captures": { "1": { "name": "punctuation.section.scope.begin.swift" }, "2": { "name": "punctuation.section.scope.end.swift" } }, "comment": "Allows the special return snippet to fire.", "match": "(\\[)(\\])" } ] }, "shebang-line": { "captures": { "1": { "name": "punctuation.definition.comment.line.shebang.swift" } }, "comment": "Shebang line", "match": "^(#!).*$", "name": "comment.line.shebang.swift" }, "special-literal": { "match": "\\b__(FILE|LINE|COLUMN|FUNCTION)__\\b", "name": "keyword.other.literal.swift" }, "storage-type": { "match": "\\b(var|func|let|class|enum|struct|protocol|extension|typealias)\\b", "name": "storage.type.swift" }, "string-literal": { "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.swift" } }, "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.swift" } }, "name": "string.quoted.double.swift", "patterns": [ { "captures": { "1": { "name": "punctuation.definition.escape.swift" } }, "match": "(\\\\)[0\\\\tnr\"']", "name": "constant.character.escape.swift" }, { "captures": { "1": { "name": "punctuation.definition.escape.swift" } }, "match": "(\\\\)u\\{\\h{1,8}\\}", "name": "constant.character.escape.swift" }, { "begin": "\\\\\\(", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.swift" } }, "contentName": "source.swift", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.swift" }, "1": { "name": "source.swift" } }, "name": "meta.embedded.line.swift", "patterns": [ { "include": "$self" }, { "begin": "\\(", "comment": "Nested parens", "end": "\\)" } ] }, { "captures": { "1": { "name": "punctuation.definition.escape.swift" } }, "match": "(\\\\).", "name": "invalid.illegal.unrecognized-escape.swift" } ] }, "switch-statement-keyword": { "comment": "switch-statement", "match": "\\b(switch|case|default|where)\\b", "name": "keyword.control.switch.swift" }, "ternary-operator": { "match": "(?<=[\\s(\\[{,;:])(\\?|:)(?=[\\s)\\]},;:])", "name": "keyword.operator.ternary.swift" }, "type": { "comment": "type", "patterns": [ { "include": "#builtin-type" }, { "include": "#collection-type" }, { "include": "#optional-type" }, { "include": "#protocol-composition-type" } ] }, "type-casting-operator": { "match": "\\b(is\\b|as([!?]\\B|\\b))", "name": "keyword.operator.type-casting.swift" } }, "scopeName": "source.swift", "uuid": "D133338A-DEED-4ECC-9852-A392C44D10AC" }