Files
docs/node_modules/@shikijs/langs/dist/swift.mjs

6 lines
96 KiB
JavaScript
Raw Normal View History

2025-08-27 14:05:33 +08:00
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Swift\",\"fileTypes\":[\"swift\"],\"firstLineMatch\":\"^#!/.*\\\\bswift\",\"name\":\"swift\",\"patterns\":[{\"include\":\"#root\"}],\"repository\":{\"async-throws\":{\"captures\":{\"1\":{\"name\":\"invalid.illegal.await-must-precede-throws.swift\"},\"2\":{\"name\":\"storage.modifier.exception.swift\"},\"3\":{\"name\":\"storage.modifier.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|visionOS|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\"}},\"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\":[{\"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\"},{\"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(?:Muta
export default [
lang
]