%PDF- %PDF-
Direktori : /proc/thread-self/root/www/varak.net/nextcloud.varak.net/apps/text/js/ |
Current File : //proc/thread-self/root/www/varak.net/nextcloud.varak.net/apps/text/js/swift-DwqT-Gzy.chunk.mjs.map |
{"version":3,"file":"swift-DwqT-Gzy.chunk.mjs","sources":["../node_modules/highlight.js/lib/languages/swift.js"],"sourcesContent":["/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/**\n * @param { Array<string | RegExp | Object> } args\n * @returns {object}\n */\nfunction stripOptionsFromArgs(args) {\n const opts = args[args.length - 1];\n\n if (typeof opts === 'object' && opts.constructor === Object) {\n args.splice(args.length - 1, 1);\n return opts;\n } else {\n return {};\n }\n}\n\n/** @typedef { {capture?: boolean} } RegexEitherOptions */\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args\n * @returns {string}\n */\nfunction either(...args) {\n /** @type { object & {capture?: boolean} } */\n const opts = stripOptionsFromArgs(args);\n const joined = '('\n + (opts.capture ? \"\" : \"?:\")\n + args.map((x) => source(x)).join(\"|\") + \")\";\n return joined;\n}\n\nconst keywordWrapper = keyword => concat(\n /\\b/,\n keyword,\n /\\w$/.test(keyword) ? /\\b/ : /\\B/\n);\n\n// Keywords that require a leading dot.\nconst dotKeywords = [\n 'Protocol', // contextual\n 'Type' // contextual\n].map(keywordWrapper);\n\n// Keywords that may have a leading dot.\nconst optionalDotKeywords = [\n 'init',\n 'self'\n].map(keywordWrapper);\n\n// should register as keyword, not type\nconst keywordTypes = [\n 'Any',\n 'Self'\n];\n\n// Regular keywords and literals.\nconst keywords = [\n // strings below will be fed into the regular `keywords` engine while regex\n // will result in additional modes being created to scan for those keywords to\n // avoid conflicts with other rules\n 'actor',\n 'any', // contextual\n 'associatedtype',\n 'async',\n 'await',\n /as\\?/, // operator\n /as!/, // operator\n 'as', // operator\n 'borrowing', // contextual\n 'break',\n 'case',\n 'catch',\n 'class',\n 'consume', // contextual\n 'consuming', // contextual\n 'continue',\n 'convenience', // contextual\n 'copy', // contextual\n 'default',\n 'defer',\n 'deinit',\n 'didSet', // contextual\n 'distributed',\n 'do',\n 'dynamic', // contextual\n 'each',\n 'else',\n 'enum',\n 'extension',\n 'fallthrough',\n /fileprivate\\(set\\)/,\n 'fileprivate',\n 'final', // contextual\n 'for',\n 'func',\n 'get', // contextual\n 'guard',\n 'if',\n 'import',\n 'indirect', // contextual\n 'infix', // contextual\n /init\\?/,\n /init!/,\n 'inout',\n /internal\\(set\\)/,\n 'internal',\n 'in',\n 'is', // operator\n 'isolated', // contextual\n 'nonisolated', // contextual\n 'lazy', // contextual\n 'let',\n 'macro',\n 'mutating', // contextual\n 'nonmutating', // contextual\n /open\\(set\\)/, // contextual\n 'open', // contextual\n 'operator',\n 'optional', // contextual\n 'override', // contextual\n 'package',\n 'postfix', // contextual\n 'precedencegroup',\n 'prefix', // contextual\n /private\\(set\\)/,\n 'private',\n 'protocol',\n /public\\(set\\)/,\n 'public',\n 'repeat',\n 'required', // contextual\n 'rethrows',\n 'return',\n 'set', // contextual\n 'some', // contextual\n 'static',\n 'struct',\n 'subscript',\n 'super',\n 'switch',\n 'throws',\n 'throw',\n /try\\?/, // operator\n /try!/, // operator\n 'try', // operator\n 'typealias',\n /unowned\\(safe\\)/, // contextual\n /unowned\\(unsafe\\)/, // contextual\n 'unowned', // contextual\n 'var',\n 'weak', // contextual\n 'where',\n 'while',\n 'willSet' // contextual\n];\n\n// NOTE: Contextual keywords are reserved only in specific contexts.\n// Ideally, these should be matched using modes to avoid false positives.\n\n// Literals.\nconst literals = [\n 'false',\n 'nil',\n 'true'\n];\n\n// Keywords used in precedence groups.\nconst precedencegroupKeywords = [\n 'assignment',\n 'associativity',\n 'higherThan',\n 'left',\n 'lowerThan',\n 'none',\n 'right'\n];\n\n// Keywords that start with a number sign (#).\n// #(un)available is handled separately.\nconst numberSignKeywords = [\n '#colorLiteral',\n '#column',\n '#dsohandle',\n '#else',\n '#elseif',\n '#endif',\n '#error',\n '#file',\n '#fileID',\n '#fileLiteral',\n '#filePath',\n '#function',\n '#if',\n '#imageLiteral',\n '#keyPath',\n '#line',\n '#selector',\n '#sourceLocation',\n '#warning'\n];\n\n// Global functions in the Standard Library.\nconst builtIns = [\n 'abs',\n 'all',\n 'any',\n 'assert',\n 'assertionFailure',\n 'debugPrint',\n 'dump',\n 'fatalError',\n 'getVaList',\n 'isKnownUniquelyReferenced',\n 'max',\n 'min',\n 'numericCast',\n 'pointwiseMax',\n 'pointwiseMin',\n 'precondition',\n 'preconditionFailure',\n 'print',\n 'readLine',\n 'repeatElement',\n 'sequence',\n 'stride',\n 'swap',\n 'swift_unboxFromSwiftValueWithType',\n 'transcode',\n 'type',\n 'unsafeBitCast',\n 'unsafeDowncast',\n 'withExtendedLifetime',\n 'withUnsafeMutablePointer',\n 'withUnsafePointer',\n 'withVaList',\n 'withoutActuallyEscaping',\n 'zip'\n];\n\n// Valid first characters for operators.\nconst operatorHead = either(\n /[/=\\-+!*%<>&|^~?]/,\n /[\\u00A1-\\u00A7]/,\n /[\\u00A9\\u00AB]/,\n /[\\u00AC\\u00AE]/,\n /[\\u00B0\\u00B1]/,\n /[\\u00B6\\u00BB\\u00BF\\u00D7\\u00F7]/,\n /[\\u2016-\\u2017]/,\n /[\\u2020-\\u2027]/,\n /[\\u2030-\\u203E]/,\n /[\\u2041-\\u2053]/,\n /[\\u2055-\\u205E]/,\n /[\\u2190-\\u23FF]/,\n /[\\u2500-\\u2775]/,\n /[\\u2794-\\u2BFF]/,\n /[\\u2E00-\\u2E7F]/,\n /[\\u3001-\\u3003]/,\n /[\\u3008-\\u3020]/,\n /[\\u3030]/\n);\n\n// Valid characters for operators.\nconst operatorCharacter = either(\n operatorHead,\n /[\\u0300-\\u036F]/,\n /[\\u1DC0-\\u1DFF]/,\n /[\\u20D0-\\u20FF]/,\n /[\\uFE00-\\uFE0F]/,\n /[\\uFE20-\\uFE2F]/\n // TODO: The following characters are also allowed, but the regex isn't supported yet.\n // /[\\u{E0100}-\\u{E01EF}]/u\n);\n\n// Valid operator.\nconst operator = concat(operatorHead, operatorCharacter, '*');\n\n// Valid first characters for identifiers.\nconst identifierHead = either(\n /[a-zA-Z_]/,\n /[\\u00A8\\u00AA\\u00AD\\u00AF\\u00B2-\\u00B5\\u00B7-\\u00BA]/,\n /[\\u00BC-\\u00BE\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF]/,\n /[\\u0100-\\u02FF\\u0370-\\u167F\\u1681-\\u180D\\u180F-\\u1DBF]/,\n /[\\u1E00-\\u1FFF]/,\n /[\\u200B-\\u200D\\u202A-\\u202E\\u203F-\\u2040\\u2054\\u2060-\\u206F]/,\n /[\\u2070-\\u20CF\\u2100-\\u218F\\u2460-\\u24FF\\u2776-\\u2793]/,\n /[\\u2C00-\\u2DFF\\u2E80-\\u2FFF]/,\n /[\\u3004-\\u3007\\u3021-\\u302F\\u3031-\\u303F\\u3040-\\uD7FF]/,\n /[\\uF900-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFE1F\\uFE30-\\uFE44]/,\n /[\\uFE47-\\uFEFE\\uFF00-\\uFFFD]/ // Should be /[\\uFE47-\\uFFFD]/, but we have to exclude FEFF.\n // The following characters are also allowed, but the regexes aren't supported yet.\n // /[\\u{10000}-\\u{1FFFD}\\u{20000-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}]/u,\n // /[\\u{50000}-\\u{5FFFD}\\u{60000-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}]/u,\n // /[\\u{90000}-\\u{9FFFD}\\u{A0000-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}]/u,\n // /[\\u{D0000}-\\u{DFFFD}\\u{E0000-\\u{EFFFD}]/u\n);\n\n// Valid characters for identifiers.\nconst identifierCharacter = either(\n identifierHead,\n /\\d/,\n /[\\u0300-\\u036F\\u1DC0-\\u1DFF\\u20D0-\\u20FF\\uFE20-\\uFE2F]/\n);\n\n// Valid identifier.\nconst identifier = concat(identifierHead, identifierCharacter, '*');\n\n// Valid type identifier.\nconst typeIdentifier = concat(/[A-Z]/, identifierCharacter, '*');\n\n// Built-in attributes, which are highlighted as keywords.\n// @available is handled separately.\n// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes\nconst keywordAttributes = [\n 'attached',\n 'autoclosure',\n concat(/convention\\(/, either('swift', 'block', 'c'), /\\)/),\n 'discardableResult',\n 'dynamicCallable',\n 'dynamicMemberLookup',\n 'escaping',\n 'freestanding',\n 'frozen',\n 'GKInspectable',\n 'IBAction',\n 'IBDesignable',\n 'IBInspectable',\n 'IBOutlet',\n 'IBSegueAction',\n 'inlinable',\n 'main',\n 'nonobjc',\n 'NSApplicationMain',\n 'NSCopying',\n 'NSManaged',\n concat(/objc\\(/, identifier, /\\)/),\n 'objc',\n 'objcMembers',\n 'propertyWrapper',\n 'requires_stored_property_inits',\n 'resultBuilder',\n 'Sendable',\n 'testable',\n 'UIApplicationMain',\n 'unchecked',\n 'unknown',\n 'usableFromInline',\n 'warn_unqualified_access'\n];\n\n// Contextual keywords used in @available and #(un)available.\nconst availabilityKeywords = [\n 'iOS',\n 'iOSApplicationExtension',\n 'macOS',\n 'macOSApplicationExtension',\n 'macCatalyst',\n 'macCatalystApplicationExtension',\n 'watchOS',\n 'watchOSApplicationExtension',\n 'tvOS',\n 'tvOSApplicationExtension',\n 'swift'\n];\n\n/*\nLanguage: Swift\nDescription: Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.\nAuthor: Steven Van Impe <steven.vanimpe@icloud.com>\nContributors: Chris Eidhof <chris@eidhof.nl>, Nate Cook <natecook@gmail.com>, Alexander Lichter <manniL@gmx.net>, Richard Gibson <gibson042@github>\nWebsite: https://swift.org\nCategory: common, system\n*/\n\n\n/** @type LanguageFn */\nfunction swift(hljs) {\n const WHITESPACE = {\n match: /\\s+/,\n relevance: 0\n };\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID411\n const BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n { contains: [ 'self' ] }\n );\n const COMMENTS = [\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT\n ];\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID413\n // https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html\n const DOT_KEYWORD = {\n match: [\n /\\./,\n either(...dotKeywords, ...optionalDotKeywords)\n ],\n className: { 2: \"keyword\" }\n };\n const KEYWORD_GUARD = {\n // Consume .keyword to prevent highlighting properties and methods as keywords.\n match: concat(/\\./, either(...keywords)),\n relevance: 0\n };\n const PLAIN_KEYWORDS = keywords\n .filter(kw => typeof kw === 'string')\n .concat([ \"_|0\" ]); // seems common, so 0 relevance\n const REGEX_KEYWORDS = keywords\n .filter(kw => typeof kw !== 'string') // find regex\n .concat(keywordTypes)\n .map(keywordWrapper);\n const KEYWORD = { variants: [\n {\n className: 'keyword',\n match: either(...REGEX_KEYWORDS, ...optionalDotKeywords)\n }\n ] };\n // find all the regular keywords\n const KEYWORDS = {\n $pattern: either(\n /\\b\\w+/, // regular keywords\n /#\\w+/ // number keywords\n ),\n keyword: PLAIN_KEYWORDS\n .concat(numberSignKeywords),\n literal: literals\n };\n const KEYWORD_MODES = [\n DOT_KEYWORD,\n KEYWORD_GUARD,\n KEYWORD\n ];\n\n // https://github.com/apple/swift/tree/main/stdlib/public/core\n const BUILT_IN_GUARD = {\n // Consume .built_in to prevent highlighting properties and methods.\n match: concat(/\\./, either(...builtIns)),\n relevance: 0\n };\n const BUILT_IN = {\n className: 'built_in',\n match: concat(/\\b/, either(...builtIns), /(?=\\()/)\n };\n const BUILT_INS = [\n BUILT_IN_GUARD,\n BUILT_IN\n ];\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID418\n const OPERATOR_GUARD = {\n // Prevent -> from being highlighting as an operator.\n match: /->/,\n relevance: 0\n };\n const OPERATOR = {\n className: 'operator',\n relevance: 0,\n variants: [\n { match: operator },\n {\n // dot-operator: only operators that start with a dot are allowed to use dots as\n // characters (..., ...<, .*, etc). So there rule here is: a dot followed by one or more\n // characters that may also include dots.\n match: `\\\\.(\\\\.|${operatorCharacter})+` }\n ]\n };\n const OPERATORS = [\n OPERATOR_GUARD,\n OPERATOR\n ];\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_numeric-literal\n // TODO: Update for leading `-` after lookbehind is supported everywhere\n const decimalDigits = '([0-9]_*)+';\n const hexDigits = '([0-9a-fA-F]_*)+';\n const NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n { match: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\\\b` },\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n { match: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\\\b` },\n // octal-literal\n { match: /\\b0o([0-7]_*)+\\b/ },\n // binary-literal\n { match: /\\b0b([01]_*)+\\b/ }\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_string-literal\n const ESCAPED_CHARACTER = (rawDelimiter = \"\") => ({\n className: 'subst',\n variants: [\n { match: concat(/\\\\/, rawDelimiter, /[0\\\\tnr\"']/) },\n { match: concat(/\\\\/, rawDelimiter, /u\\{[0-9a-fA-F]{1,8}\\}/) }\n ]\n });\n const ESCAPED_NEWLINE = (rawDelimiter = \"\") => ({\n className: 'subst',\n match: concat(/\\\\/, rawDelimiter, /[\\t ]*(?:[\\r\\n]|\\r\\n)/)\n });\n const INTERPOLATION = (rawDelimiter = \"\") => ({\n className: 'subst',\n label: \"interpol\",\n begin: concat(/\\\\/, rawDelimiter, /\\(/),\n end: /\\)/\n });\n const MULTILINE_STRING = (rawDelimiter = \"\") => ({\n begin: concat(rawDelimiter, /\"\"\"/),\n end: concat(/\"\"\"/, rawDelimiter),\n contains: [\n ESCAPED_CHARACTER(rawDelimiter),\n ESCAPED_NEWLINE(rawDelimiter),\n INTERPOLATION(rawDelimiter)\n ]\n });\n const SINGLE_LINE_STRING = (rawDelimiter = \"\") => ({\n begin: concat(rawDelimiter, /\"/),\n end: concat(/\"/, rawDelimiter),\n contains: [\n ESCAPED_CHARACTER(rawDelimiter),\n INTERPOLATION(rawDelimiter)\n ]\n });\n const STRING = {\n className: 'string',\n variants: [\n MULTILINE_STRING(),\n MULTILINE_STRING(\"#\"),\n MULTILINE_STRING(\"##\"),\n MULTILINE_STRING(\"###\"),\n SINGLE_LINE_STRING(),\n SINGLE_LINE_STRING(\"#\"),\n SINGLE_LINE_STRING(\"##\"),\n SINGLE_LINE_STRING(\"###\")\n ]\n };\n\n const REGEXP_CONTENTS = [\n hljs.BACKSLASH_ESCAPE,\n {\n begin: /\\[/,\n end: /\\]/,\n relevance: 0,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n }\n ];\n\n const BARE_REGEXP_LITERAL = {\n begin: /\\/[^\\s](?=[^/\\n]*\\/)/,\n end: /\\//,\n contains: REGEXP_CONTENTS\n };\n\n const EXTENDED_REGEXP_LITERAL = (rawDelimiter) => {\n const begin = concat(rawDelimiter, /\\//);\n const end = concat(/\\//, rawDelimiter);\n return {\n begin,\n end,\n contains: [\n ...REGEXP_CONTENTS,\n {\n scope: \"comment\",\n begin: `#(?!.*${end})`,\n end: /$/,\n },\n ],\n };\n };\n\n // https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#Regular-Expression-Literals\n const REGEXP = {\n scope: \"regexp\",\n variants: [\n EXTENDED_REGEXP_LITERAL('###'),\n EXTENDED_REGEXP_LITERAL('##'),\n EXTENDED_REGEXP_LITERAL('#'),\n BARE_REGEXP_LITERAL\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412\n const QUOTED_IDENTIFIER = { match: concat(/`/, identifier, /`/) };\n const IMPLICIT_PARAMETER = {\n className: 'variable',\n match: /\\$\\d+/\n };\n const PROPERTY_WRAPPER_PROJECTION = {\n className: 'variable',\n match: `\\\\$${identifierCharacter}+`\n };\n const IDENTIFIERS = [\n QUOTED_IDENTIFIER,\n IMPLICIT_PARAMETER,\n PROPERTY_WRAPPER_PROJECTION\n ];\n\n // https://docs.swift.org/swift-book/ReferenceManual/Attributes.html\n const AVAILABLE_ATTRIBUTE = {\n match: /(@|#(un)?)available/,\n scope: 'keyword',\n starts: { contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: availabilityKeywords,\n contains: [\n ...OPERATORS,\n NUMBER,\n STRING\n ]\n }\n ] }\n };\n\n const KEYWORD_ATTRIBUTE = {\n scope: 'keyword',\n match: concat(/@/, either(...keywordAttributes), lookahead(either(/\\(/, /\\s+/))),\n };\n\n const USER_DEFINED_ATTRIBUTE = {\n scope: 'meta',\n match: concat(/@/, identifier)\n };\n\n const ATTRIBUTES = [\n AVAILABLE_ATTRIBUTE,\n KEYWORD_ATTRIBUTE,\n USER_DEFINED_ATTRIBUTE\n ];\n\n // https://docs.swift.org/swift-book/ReferenceManual/Types.html\n const TYPE = {\n match: lookahead(/\\b[A-Z]/),\n relevance: 0,\n contains: [\n { // Common Apple frameworks, for relevance boost\n className: 'type',\n match: concat(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, '+')\n },\n { // Type identifier\n className: 'type',\n match: typeIdentifier,\n relevance: 0\n },\n { // Optional type\n match: /[?!]+/,\n relevance: 0\n },\n { // Variadic parameter\n match: /\\.\\.\\./,\n relevance: 0\n },\n { // Protocol composition\n match: concat(/\\s+&\\s+/, lookahead(typeIdentifier)),\n relevance: 0\n }\n ]\n };\n const GENERIC_ARGUMENTS = {\n begin: /</,\n end: />/,\n keywords: KEYWORDS,\n contains: [\n ...COMMENTS,\n ...KEYWORD_MODES,\n ...ATTRIBUTES,\n OPERATOR_GUARD,\n TYPE\n ]\n };\n TYPE.contains.push(GENERIC_ARGUMENTS);\n\n // https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID552\n // Prevents element names from being highlighted as keywords.\n const TUPLE_ELEMENT_NAME = {\n match: concat(identifier, /\\s*:/),\n keywords: \"_|0\",\n relevance: 0\n };\n // Matches tuples as well as the parameter list of a function type.\n const TUPLE = {\n begin: /\\(/,\n end: /\\)/,\n relevance: 0,\n keywords: KEYWORDS,\n contains: [\n 'self',\n TUPLE_ELEMENT_NAME,\n ...COMMENTS,\n REGEXP,\n ...KEYWORD_MODES,\n ...BUILT_INS,\n ...OPERATORS,\n NUMBER,\n STRING,\n ...IDENTIFIERS,\n ...ATTRIBUTES,\n TYPE\n ]\n };\n\n const GENERIC_PARAMETERS = {\n begin: /</,\n end: />/,\n keywords: 'repeat each',\n contains: [\n ...COMMENTS,\n TYPE\n ]\n };\n const FUNCTION_PARAMETER_NAME = {\n begin: either(\n lookahead(concat(identifier, /\\s*:/)),\n lookahead(concat(identifier, /\\s+/, identifier, /\\s*:/))\n ),\n end: /:/,\n relevance: 0,\n contains: [\n {\n className: 'keyword',\n match: /\\b_\\b/\n },\n {\n className: 'params',\n match: identifier\n }\n ]\n };\n const FUNCTION_PARAMETERS = {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS,\n contains: [\n FUNCTION_PARAMETER_NAME,\n ...COMMENTS,\n ...KEYWORD_MODES,\n ...OPERATORS,\n NUMBER,\n STRING,\n ...ATTRIBUTES,\n TYPE,\n TUPLE\n ],\n endsParent: true,\n illegal: /[\"']/\n };\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID362\n // https://docs.swift.org/swift-book/documentation/the-swift-programming-language/declarations/#Macro-Declaration\n const FUNCTION_OR_MACRO = {\n match: [\n /(func|macro)/,\n /\\s+/,\n either(QUOTED_IDENTIFIER.match, identifier, operator)\n ],\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n contains: [\n GENERIC_PARAMETERS,\n FUNCTION_PARAMETERS,\n WHITESPACE\n ],\n illegal: [\n /\\[/,\n /%/\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID375\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID379\n const INIT_SUBSCRIPT = {\n match: [\n /\\b(?:subscript|init[?!]?)/,\n /\\s*(?=[<(])/,\n ],\n className: { 1: \"keyword\" },\n contains: [\n GENERIC_PARAMETERS,\n FUNCTION_PARAMETERS,\n WHITESPACE\n ],\n illegal: /\\[|%/\n };\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID380\n const OPERATOR_DECLARATION = {\n match: [\n /operator/,\n /\\s+/,\n operator\n ],\n className: {\n 1: \"keyword\",\n 3: \"title\"\n }\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID550\n const PRECEDENCEGROUP = {\n begin: [\n /precedencegroup/,\n /\\s+/,\n typeIdentifier\n ],\n className: {\n 1: \"keyword\",\n 3: \"title\"\n },\n contains: [ TYPE ],\n keywords: [\n ...precedencegroupKeywords,\n ...literals\n ],\n end: /}/\n };\n\n const TYPE_DECLARATION = {\n begin: [\n /(struct|protocol|class|extension|enum|actor)/,\n /\\s+/,\n identifier,\n /\\s*/,\n ],\n beginScope: {\n 1: \"keyword\",\n 3: \"title.class\"\n },\n keywords: KEYWORDS,\n contains: [\n GENERIC_PARAMETERS,\n ...KEYWORD_MODES,\n {\n begin: /:/,\n end: /\\{/,\n keywords: KEYWORDS,\n contains: [\n {\n scope: \"title.class.inherited\",\n match: typeIdentifier,\n },\n ...KEYWORD_MODES,\n ],\n relevance: 0,\n },\n ]\n };\n\n // Add supported submodes to string interpolation.\n for (const variant of STRING.variants) {\n const interpolation = variant.contains.find(mode => mode.label === \"interpol\");\n // TODO: Interpolation can contain any expression, so there's room for improvement here.\n interpolation.keywords = KEYWORDS;\n const submodes = [\n ...KEYWORD_MODES,\n ...BUILT_INS,\n ...OPERATORS,\n NUMBER,\n STRING,\n ...IDENTIFIERS\n ];\n interpolation.contains = [\n ...submodes,\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n 'self',\n ...submodes\n ]\n }\n ];\n }\n\n return {\n name: 'Swift',\n keywords: KEYWORDS,\n contains: [\n ...COMMENTS,\n FUNCTION_OR_MACRO,\n INIT_SUBSCRIPT,\n TYPE_DECLARATION,\n OPERATOR_DECLARATION,\n PRECEDENCEGROUP,\n {\n beginKeywords: 'import',\n end: /$/,\n contains: [ ...COMMENTS ],\n relevance: 0\n },\n REGEXP,\n ...KEYWORD_MODES,\n ...BUILT_INS,\n ...OPERATORS,\n NUMBER,\n STRING,\n ...IDENTIFIERS,\n ...ATTRIBUTES,\n TYPE,\n TUPLE\n ]\n };\n}\n\nmodule.exports = swift;\n"],"names":["source","re","lookahead","concat","args","x","stripOptionsFromArgs","opts","either","keywordWrapper","keyword","dotKeywords","optionalDotKeywords","keywordTypes","keywords","literals","precedencegroupKeywords","numberSignKeywords","builtIns","operatorHead","operatorCharacter","operator","identifierHead","identifierCharacter","identifier","typeIdentifier","keywordAttributes","availabilityKeywords","swift","hljs","WHITESPACE","BLOCK_COMMENT","COMMENTS","DOT_KEYWORD","KEYWORD_GUARD","PLAIN_KEYWORDS","kw","REGEX_KEYWORDS","KEYWORD","KEYWORDS","KEYWORD_MODES","BUILT_IN_GUARD","BUILT_IN","BUILT_INS","OPERATOR_GUARD","OPERATOR","OPERATORS","decimalDigits","hexDigits","NUMBER","ESCAPED_CHARACTER","rawDelimiter","ESCAPED_NEWLINE","INTERPOLATION","MULTILINE_STRING","SINGLE_LINE_STRING","STRING","REGEXP_CONTENTS","BARE_REGEXP_LITERAL","EXTENDED_REGEXP_LITERAL","begin","end","REGEXP","QUOTED_IDENTIFIER","IMPLICIT_PARAMETER","PROPERTY_WRAPPER_PROJECTION","IDENTIFIERS","AVAILABLE_ATTRIBUTE","KEYWORD_ATTRIBUTE","USER_DEFINED_ATTRIBUTE","ATTRIBUTES","TYPE","GENERIC_ARGUMENTS","TUPLE_ELEMENT_NAME","TUPLE","GENERIC_PARAMETERS","FUNCTION_PARAMETER_NAME","FUNCTION_PARAMETERS","FUNCTION_OR_MACRO","INIT_SUBSCRIPT","OPERATOR_DECLARATION","PRECEDENCEGROUP","TYPE_DECLARATION","variant","interpolation","mode","submodes","swift_1"],"mappings":";8YASA,SAASA,EAAOC,EAAI,CAClB,OAAKA,EACD,OAAOA,GAAO,SAAiBA,EAE5BA,EAAG,OAHM,IAIlB,CAMA,SAASC,EAAUD,EAAI,CACrB,OAAOE,EAAO,MAAOF,EAAI,GAAG,CAC9B,CAMA,SAASE,KAAUC,EAAM,CAEvB,OADeA,EAAK,IAAKC,GAAML,EAAOK,CAAC,CAAC,EAAE,KAAK,EAAE,CAEnD,CAMA,SAASC,GAAqBF,EAAM,CAClC,MAAMG,EAAOH,EAAKA,EAAK,OAAS,CAAC,EAEjC,OAAI,OAAOG,GAAS,UAAYA,EAAK,cAAgB,QACnDH,EAAK,OAAOA,EAAK,OAAS,EAAG,CAAC,EACvBG,GAEA,EAEX,CAWA,SAASC,KAAUJ,EAAM,CAMvB,MAHe,KADFE,GAAqBF,CAAI,EAE5B,QAAU,GAAK,MACrBA,EAAK,IAAKC,GAAML,EAAOK,CAAC,CAAC,EAAE,KAAK,GAAG,EAAI,GAE7C,CAEA,MAAMI,EAAiBC,GAAWP,EAChC,KACAO,EACA,MAAM,KAAKA,CAAO,EAAI,KAAO,IAC/B,EAGMC,GAAc,CAClB,WACA,MACF,EAAE,IAAIF,CAAc,EAGdG,EAAsB,CAC1B,OACA,MACF,EAAE,IAAIH,CAAc,EAGdI,GAAe,CACnB,MACA,MACF,EAGMC,EAAW,CAIf,QACA,MACA,iBACA,QACA,QACA,OACA,MACA,KACA,YACA,QACA,OACA,QACA,QACA,UACA,YACA,WACA,cACA,OACA,UACA,QACA,SACA,SACA,cACA,KACA,UACA,OACA,OACA,OACA,YACA,cACA,qBACA,cACA,QACA,MACA,OACA,MACA,QACA,KACA,SACA,WACA,QACA,SACA,QACA,QACA,kBACA,WACA,KACA,KACA,WACA,cACA,OACA,MACA,QACA,WACA,cACA,cACA,OACA,WACA,WACA,WACA,UACA,UACA,kBACA,SACA,iBACA,UACA,WACA,gBACA,SACA,SACA,WACA,WACA,SACA,MACA,OACA,SACA,SACA,YACA,QACA,SACA,SACA,QACA,QACA,OACA,MACA,YACA,kBACA,oBACA,UACA,MACA,OACA,QACA,QACA,SACF,EAMMC,EAAW,CACf,QACA,MACA,MACF,EAGMC,GAA0B,CAC9B,aACA,gBACA,aACA,OACA,YACA,OACA,OACF,EAIMC,GAAqB,CACzB,gBACA,UACA,aACA,QACA,UACA,SACA,SACA,QACA,UACA,eACA,YACA,YACA,MACA,gBACA,WACA,QACA,YACA,kBACA,UACF,EAGMC,EAAW,CACf,MACA,MACA,MACA,SACA,mBACA,aACA,OACA,aACA,YACA,4BACA,MACA,MACA,cACA,eACA,eACA,eACA,sBACA,QACA,WACA,gBACA,WACA,SACA,OACA,oCACA,YACA,OACA,gBACA,iBACA,uBACA,2BACA,oBACA,aACA,0BACA,KACF,EAGMC,EAAeX,EACnB,oBACA,kBACA,iBACA,iBACA,iBACA,mCACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,UACF,EAGMY,EAAoBZ,EACxBW,EACA,kBACA,kBACA,kBACA,kBACA,iBAGF,EAGME,EAAWlB,EAAOgB,EAA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ACH,GAAGI,EACHC,CACD,CACL,EAEQI,EAAqB,CACzB,MAAO,IACP,IAAK,IACL,SAAU,cACV,SAAU,CACR,GAAG3C,EACHuC,CACD,CACL,EACQK,GAA0B,CAC9B,MAAOpE,EACLN,EAAUC,EAAOqB,EAAY,MAAM,CAAC,EACpCtB,EAAUC,EAAOqB,EAAY,MAAOA,EAAY,MAAM,CAAC,CACxD,EACD,IAAK,IACL,UAAW,EACX,SAAU,CACR,CACE,UAAW,UACX,MAAO,OACR,EACD,CACE,UAAW,SACX,MAAOA,CACR,CACF,CACL,EACQqD,EAAsB,CAC1B,MAAO,KACP,IAAK,KACL,SAAUtC,EACV,SAAU,CACRqC,GACA,GAAG5C,EACH,GAAGQ,EACH,GAAGM,EACHG,EACAO,EACA,GAAGc,EACHC,EACAG,CACD,EACD,WAAY,GACZ,QAAS,MACb,EAGQI,GAAoB,CACxB,MAAO,CACL,eACA,MACAtE,EAAOuD,EAAkB,MAAOvC,EAAYH,CAAQ,CACrD,EACD,UAAW,CACT,EAAG,UACH,EAAG,gBACJ,EACD,SAAU,CACRsD,EACAE,EACA/C,CACD,EACD,QAAS,CACP,KACA,GACD,CACL,EAIQiD,GAAiB,CACrB,MAAO,CACL,4BACA,aACD,EACD,UAAW,CAAE,EAAG,SAAW,EAC3B,SAAU,CACRJ,EACAE,EACA/C,CACD,EACD,QAAS,MACb,EAEQkD,GAAuB,CAC3B,MAAO,CACL,WACA,MACA3D,CACD,EACD,UAAW,CACT,EAAG,UACH,EAAG,OACJ,CACL,EAGQ4D,GAAkB,CACtB,MAAO,CACL,kBACA,MACAxD,CACD,EACD,UAAW,CACT,EAAG,UACH,EAAG,OACJ,EACD,SAAU,CAAE8C,CAAM,EAClB,SAAU,CACR,GAAGvD,GACH,GAAGD,CACJ,EACD,IAAK,GACT,EAEQmE,GAAmB,CACvB,MAAO,CACL,+CACA,MACA1D,EACA,KACD,EACD,WAAY,CACV,EAAG,UACH,EAAG,aACJ,EACD,SAAUe,EACV,SAAU,CACRoC,EACA,GAAGnC,EACH,CACE,MAAO,IACP,IAAK,KACL,SAAUD,EACV,SAAU,CACR,CACE,MAAO,wBACP,MAAOd,CACR,EACD,GAAGe,CACJ,EACD,UAAW,CACZ,CACF,CACL,EAGE,UAAW2C,KAAW3B,EAAO,SAAU,CACrC,MAAM4B,EAAgBD,EAAQ,SAAS,KAAKE,IAAQA,GAAK,QAAU,UAAU,EAE7ED,EAAc,SAAW7C,EACzB,MAAM+C,EAAW,CACf,GAAG9C,EACH,GAAGG,EACH,GAAGG,EACHG,EACAO,EACA,GAAGU,CACT,EACIkB,EAAc,SAAW,CACvB,GAAGE,EACH,CACE,MAAO,KACP,IAAK,KACL,SAAU,CACR,OACA,GAAGA,CACJ,CACF,CACP,CACG,CAED,MAAO,CACL,KAAM,QACN,SAAU/C,EACV,SAAU,CACR,GAAGP,EACH8C,GACAC,GACAG,GACAF,GACAC,GACA,CACE,cAAe,SACf,IAAK,IACL,SAAU,CAAE,GAAGjD,CAAU,EACzB,UAAW,CACZ,EACD8B,EACA,GAAGtB,EACH,GAAGG,EACH,GAAGG,EACHG,EACAO,EACA,GAAGU,EACH,GAAGI,EACHC,EACAG,CACD,CACL,CACA,CAEA,IAAAa,EAAiB3D","x_google_ignoreList":[0]}