site/node_modules/shiki/dist/langs/swift.mjs

10 lines
99 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Swift", "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|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(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:RetainedValue|UnretainedValue)|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAn
"\\k'" NamedOrNumberRef "'"
'\\g<' NamedOrNumberRef '>'
"\\g'" NamedOrNumberRef "'"`, "match": "(?x)(\\\\[gk](<)|\\\\[gk]') (?: ((?!\\d)\\w+) (?:([+-])(\\d+))? | ([+-]?\\d+) (?:([+-])(\\d+))? ) ((?(2)>|'))" }, { "captures": { "1": { "name": "constant.character.escape.backslash.regexp" }, "2": { "name": "variable.other.group-name.regexp" }, "3": { "name": "keyword.operator.recursion-level.regexp" }, "4": { "name": "constant.numeric.integer.decimal.regexp" }, "5": { "name": "constant.character.escape.backslash.regexp" } }, "comment": "'\\k{' NamedRef '}'", "match": "(?x)(\\\\k\\{) ((?!\\d)\\w+) (?:([+-])(\\d+))? (\\})" }, { "match": "\\\\[1-9][0-9]+", "name": "keyword.other.back-reference.regexp" }, { "captures": { "1": { "name": "keyword.other.back-reference.regexp" }, "2": { "name": "variable.other.group-name.regexp" }, "3": { "name": "keyword.operator.recursion-level.regexp" }, "4": { "name": "constant.numeric.integer.decimal.regexp" }, "5": { "name": "keyword.other.back-reference.regexp" } }, "comment": "'(?P=' NamedRef ')'", "match": "(?x)(\\(\\?(?:P[=>]|&)) ((?!\\d)\\w+) (?:([+-])(\\d+))? (\\))" }, { "match": "\\(\\?R\\)", "name": "keyword.other.back-reference.regexp" }, { "captures": { "1": { "name": "keyword.other.back-reference.regexp" }, "2": { "name": "constant.numeric.integer.decimal.regexp" }, "3": { "name": "keyword.operator.recursion-level.regexp" }, "4": { "name": "constant.numeric.integer.decimal.regexp" }, "5": { "name": "keyword.other.back-reference.regexp" } }, "comment": "'(?' NumberRef ')'", "match": "(?x)(\\(\\?) ([+-]?\\d+) (?:([+-])(\\d+))? (\\))" }] }, "literals-regular-expression-literal-backtracking-directive-or-global-matching-option": { "captures": { "1": { "name": "keyword.control.directive.regexp" }, "2": { "name": "keyword.control.directive.regexp" }, "3": { "name": "keyword.control.directive.regexp" }, "4": { "name": "variable.language.tag.regexp" }, "5": { "name": "keyword.control.directive.regexp" }, "6": { "name": "keyword.operator.assignment.regexp" }, "7": { "name": "constant.numeric.integer.decimal.regexp" }, "8": { "name": "keyword.control.directive.regexp" }, "9": { "name": "keyword.control.directive.regexp" } }, "match": "(?x)\n(\\(\\*)\n(?:\n(ACCEPT|FAIL|F|MARK(?=:)|(?=:)|COMMIT|PRUNE|SKIP|THEN)\n(?:(:)([^)]+))?\n| (?:(LIMIT_(?:DEPTH|HEAP|MATCH))(=)(\\d+))\n| (\nCRLF | CR | ANYCRLF | ANY | LF | NUL\n| BSR_ANYCRLF | BSR_UNICODE\n| NOTEMPTY_ATSTART | NOTEMPTY\n| NO_AUTO_POSSESS | NO_DOTSTAR_ANCHOR\n| NO_JIT | NO_START_OPT | UTF | UCP\n)\n)\n(\\))" }, "literals-regular-expression-literal-callout": { "captures": { "1": { "name": "punctuation.definition.group.regexp" }, "2": { "name": "keyword.control.callout.regexp" }, "3": { "name": "constant.numeric.integer.decimal.regexp" }, "4": { "name": "entity.name.function.callout.regexp" }, "5": { "name": "entity.name.function.callout.regexp" }, "6": { "name": "entity.name.function.callout.regexp" }, "7": { "name": "entity.name.function.callout.regexp" }, "8": { "name": "entity.name.function.callout.regexp" }, "9": { "name": "entity.name.function.callout.regexp" }, "10": { "name": "entity.name.function.callout.regexp" }, "11": { "name": "entity.name.function.callout.regexp" }, "12": { "name": "punctuation.definition.group.regexp" }, "13": { "name": "punctuation.definition.group.regexp" }, "14": { "name": "keyword.control.callout.regexp" }, "15": { "name": "entity.name.function.callout.regexp" }, "16": { "name": "variable.language.tag-name.regexp" }, "17": { "name": "punctuation.definition.group.regexp" }, "18": { "name": "punctuation.definition.group.regexp" }, "19": { "name": "keyword.control.callout.regexp" }, "26": { "name": "variable.language.tag-name.regexp" }, "27": { "name": "keyword.control.callout.regexp" }, "28": { "name": "punctuation.definition.group.regexp" } }, "match": "(?x)\n# PCRECallout\n(\\()(?<keyw>\\?C)\n(?:\n(?<num>\\d+)\n| `(?<name>(?:[^`]|``)*)`\n| '(?<name>(?:[^']|'')*)'\n| \"(?<name>(?:[^\"]|\"\")*)\"\n| \\^(?<name>(?:[^\\^]|\\^\\^)*)\\^\n| %(?<name>(?:[^%]|%%)*)%\n| \\#(?<name>(?:[^#]|\\#\\#)*)\\#\n| \\$(?<name>(?:[^$]|\\$\\$)*)\\$\n| \\{(?<name>(?:[^}]|\\}\\})*)\\}\n
var swift = [
lang
];
export { swift as default };