Files

1 line
79 KiB
JSON
Raw Permalink Normal View History

2025-05-09 16:55:09 +08:00
{"information_for_contributors":["This file has been converted from https://github.com/textmate/swift.tmbundle/blob/master/Syntaxes/Swift.tmLanguage","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/textmate/swift.tmbundle/commit/7a35637eb70aef3114b091c4ff6fbf6a2faa881b","name":"Swift","scopeName":"source.swift","comment":"See swift.tmbundle/grammar-test.swift for test cases.","patterns":[{"include":"#root"}],"repository":{"async-throws":{"captures":{"1":{"name":"invalid.illegal.await-must-precede-throws.swift"},"2":{"name":"keyword.control.exception.swift"},"3":{"name":"keyword.control.async.swift"}},"match":"\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b"},"attributes":{"patterns":[{"begin":"((@)available)(\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.available.swift","patterns":[{"captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}},"match":"\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?"},{"begin":"\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\G)","patterns":[{"match":"\\b[0-9]+(?:\\.[0-9]+)*\\b","name":"constant.numeric.swift"}]},{"begin":"\\b(message|renamed)\\s*(:)\\s*(?=\")","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\G)","patterns":[{"include":"#literals"}]},{"captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"keyword.other.swift"},"3":{"name":"invalid.illegal.character-not-allowed-here.swift"}},"match":"(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])"}]},{"begin":"((@)objc)(\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.objc.swift","patterns":[{"captures":{"1":{"name":"invalid.illegal.missing-colon-after-selector-piece.swift"}},"match":"\\w*(?::(?:\\w*:)*(\\w*))?","name":"entity.name.function.swift"}]},{"begin":"(@)(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)","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"}},"comment":"any other attribute","end":"(?!\\G\\()","name":"meta.attribute.swift","patterns":[{"begin":"\\(","beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.arguments.attribute.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","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","name":"support.function.swift"},{"comment":"Member functions in the standard library in Swift 3","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(?:untByEnum