diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-04-16 18:58:14 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-04-16 18:58:14 +0300 |
commit | 29c6ec26ba612ee219fdf69fa3c9996c9620c1e7 (patch) | |
tree | caaebed61bd8da8c45e508d18944280ad2528905 /js/highlight/swift.js.map | |
parent | 65e77e14366ba4a6ec4dd8b5e60b150e85e98f2b (diff) |
Bump all minor dependency updates
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'js/highlight/swift.js.map')
-rw-r--r-- | js/highlight/swift.js.map | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/highlight/swift.js.map b/js/highlight/swift.js.map index 1749c6d0d..927e4b720 100644 --- a/js/highlight/swift.js.map +++ b/js/highlight/swift.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/swift.js"],"names":["module","exports","hljs","SWIFT_KEYWORDS","$pattern","keyword","literal","built_in","BLOCK_COMMENT","COMMENT","contains","SUBST","className","begin","end","keywords","STRING","BACKSLASH_ESCAPE","variants","NUMBER","relevance","name","C_LINE_COMMENT_MODE","beginKeywords","excludeEnd","inherit","TITLE_MODE","endsParent","C_BLOCK_COMMENT_MODE","illegal"],"mappings":"oGAqKAA,EAAOC,QA3JP,SAAeC,GACb,IAAIC,EAAiB,CAGjBC,SAAU,SACVC,QAAS,qvBAUTC,QAAS,iBACTC,SAAU,0lCA2BVC,EAAgBN,EAAKO,QACvB,OACA,OACA,CACEC,SAAU,CAAC,UAGXC,EAAQ,CACVC,UAAW,QACXC,MAAO,OAAQC,IAAK,MACpBC,SAAUZ,EACVO,SAAU,IAERM,EAAS,CACXJ,UAAW,SACXF,SAAU,CAACR,EAAKe,iBAAkBN,GAClCO,SAAU,CACR,CAACL,MAAO,MAAOC,IAAK,OACpB,CAACD,MAAO,IAAKC,IAAK,OAQlBK,EAAS,CACTP,UAAW,SACXQ,UAAW,EACXF,SAAU,CAER,CAAEL,MAAO,cAPK,aAOL,iBAPK,aAOL,4BAPK,aAOL,WAIT,CAAEA,MAAO,gBAVC,mBAUD,iBAVC,mBAUD,4BAXK,aAWL,WAIT,CAAEA,MAAO,oBAGT,CAAEA,MAAO,qBAKf,OAFAF,EAAMD,SAAW,CAACS,GAEX,CACLE,KAAM,QACNN,SAAUZ,EACVO,SAAU,CACRM,EACAd,EAAKoB,oBACLd,EAzDsB,CACxBI,UAAW,OACXC,MAAO,0BARE,CACTD,UAAW,OACXC,MAAO,qBACPO,UAAW,GA+DTD,EACA,CACEP,UAAW,WACXW,cAAe,OAAQT,IAAK,KAAMU,YAAY,EAC9Cd,SAAU,CACRR,EAAKuB,QAAQvB,EAAKwB,WAAY,CAC5Bb,MAAO,6BAET,CACEA,MAAO,IAAKC,IAAK,KAEnB,CACEF,UAAW,SACXC,MAAO,KAAMC,IAAK,KAAMa,YAAY,EACpCZ,SAAUZ,EACVO,SAAU,CACR,OACAS,EACAH,EACAd,EAAK0B,qBACL,CAACf,MAAO,MAEVgB,QAAS,SAGbA,QAAS,QAEX,CACEjB,UAAW,QACXW,cAAe,uCACfR,SAAUZ,EACVW,IAAK,MACLU,YAAY,EACZd,SAAU,CACRR,EAAKuB,QAAQvB,EAAKwB,WAAY,CAACb,MAAO,4CAG1C,CACED,UAAW,OACXC,MAAO,wVAQT,CACEU,cAAe,SAAUT,IAAK,IAC9BJ,SAAU,CAACR,EAAKoB,oBAAqBd,GACrCY,UAAW","file":"highlight/swift.js?v=46055df9f52e33c86567","sourcesContent":["/*\nLanguage: Swift\nDescription: Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.\nAuthor: Chris Eidhof <chris@eidhof.nl>\nContributors: Nate Cook <natecook@gmail.com>, Alexander Lichter <manniL@gmx.net>\nWebsite: https://swift.org\nCategory: common, system\n*/\n\n\nfunction swift(hljs) {\n var SWIFT_KEYWORDS = {\n // override the pattern since the default of of /\\w+/ is not sufficient to\n // capture the keywords that start with the character \"#\"\n $pattern: /[\\w#]+/,\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set some static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\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 var decimalDigits = '([0-9]_*)+';\n var hexDigits = '([0-9a-fA-F]_*)+';\n var NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n { begin: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` +\n `([eE][+-]?(${decimalDigits}))?\\\\b` },\n\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n { begin: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` +\n `([pP][+-]?(${decimalDigits}))?\\\\b` },\n\n // octal-literal\n { begin: /\\b0o([0-7]_*)+\\b/ },\n\n // binary-literal\n { begin: /\\b0b([01]_*)+\\b/ },\n ]\n };\n SUBST.contains = [NUMBER];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBER,\n {\n className: 'function',\n beginKeywords: 'func', end: /\\{/, excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBER,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper|@main)\\\\b'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT],\n relevance: 0\n }\n ]\n };\n}\n\nmodule.exports = swift;\n"],"sourceRoot":""}
\ No newline at end of file +{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/swift.js"],"names":["source","re","lookahead","concat","args","joined","map","x","join","either","keywordWrapper","keyword","test","dotKeywords","optionalDotKeywords","keywordTypes","keywords","literals","precedencegroupKeywords","numberSignKeywords","builtIns","operatorHead","operatorCharacter","operator","identifierHead","identifierCharacter","identifier","typeIdentifier","keywordAttributes","availabilityKeywords","module","exports","hljs","WHITESPACE","match","relevance","BLOCK_COMMENT","COMMENT","contains","COMMENTS","C_LINE_COMMENT_MODE","DOT_KEYWORD","className","begin","end","excludeBegin","KEYWORD_GUARD","PLAIN_KEYWORDS","filter","kw","REGEX_KEYWORDS","KEYWORD","variants","KEYWORDS","$pattern","literal","KEYWORD_MODES","BUILT_INS","OPERATOR_GUARD","OPERATORS","NUMBER","ESCAPED_CHARACTER","rawDelimiter","ESCAPED_NEWLINE","INTERPOLATION","label","MULTILINE_STRING","SINGLE_LINE_STRING","STRING","QUOTED_IDENTIFIER","IDENTIFIERS","ATTRIBUTES","starts","TYPE","GENERIC_ARGUMENTS","push","TUPLE","FUNC_PLUS_TITLE","beginKeywords","endsParent","GENERIC_PARAMETERS","FUNCTION_PARAMETERS","illegal","FUNCTION","INIT_SUBSCRIPT","OPERATOR_DECLARATION","MATCH_NOTHING_RE","PRECEDENCEGROUP","interpolation","find","mode","submodes","name","excludeEnd","inherit","TITLE_MODE"],"mappings":"o0BASA,SAASA,EAAOC,GACd,OAAKA,EACa,iBAAPA,EAAwBA,EAE5BA,EAAGD,OAHM,KAUlB,SAASE,EAAUD,GACjB,OAAOE,EAAO,MAAOF,EAAI,KAO3B,SAASE,IAAgB,2BAANC,EAAM,yBAANA,EAAM,gBACvB,IAAMC,EAASD,EAAKE,KAAI,SAACC,GAAD,OAAOP,EAAOO,MAAIC,KAAK,IAC/C,OAAOH,EAUT,SAASI,IAAgB,2BAANL,EAAM,yBAANA,EAAM,gBACvB,IAAMC,EAAS,IAAMD,EAAKE,KAAI,SAACC,GAAD,OAAOP,EAAOO,MAAIC,KAAK,KAAO,IAC5D,OAAOH,EAGT,IAAMK,EAAiB,SAAAC,GAAO,OAAIR,EAChC,KACAQ,EACA,MAAMC,KAAKD,GAAW,KAAO,OAIzBE,EAAc,CAClB,WACA,QACAP,IAAII,GAGAI,EAAsB,CAC1B,OACA,QACAR,IAAII,GAGAK,EAAe,CACnB,MACA,QAIIC,EAAW,CAIf,iBACA,QACA,QACA,OACA,MACA,KACA,QACA,OACA,QACA,QACA,WACA,cACA,UACA,QACA,SACA,SACA,KACA,UACA,OACA,OACA,YACA,cACA,qBACA,cACA,QACA,MACA,OACA,MACA,QACA,KACA,SACA,WACA,QACA,SACA,QACA,QACA,kBACA,WACA,KACA,KACA,OACA,MACA,WACA,cACA,cACA,OACA,WACA,WACA,WACA,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,WAOIC,EAAW,CACf,QACA,MACA,QAIIC,EAA0B,CAC9B,aACA,gBACA,aACA,OACA,YACA,OACA,SAKIC,EAAqB,CACzB,gBACA,UACA,aACA,QACA,UACA,SACA,SACA,QACA,UACA,eACA,YACA,YACA,MACA,gBACA,WACA,QACA,YACA,kBACA,2BACA,YAIIC,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,OAIIC,EAAeZ,EACnB,oBACA,kBACA,iBACA,iBACA,iBACA,mCACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,YAIIa,EAAoBb,EACxBY,EACA,kBACA,kBACA,kBACA,kBACA,mBAMIE,EAAWpB,EAAOkB,EAAcC,EAAmB,KAGnDE,EAAiBf,EACrB,YACA,uDACA,yDACA,yDACA,kBACA,+DACA,yDACA,+BACA,yDACA,yDACA,gCASIgB,EAAsBhB,EAC1Be,EACA,KACA,0DAIIE,EAAavB,EAAOqB,EAAgBC,EAAqB,KAGzDE,EAAiBxB,EAAO,QAASsB,EAAqB,KAItDG,EAAoB,CACxB,cACAzB,EAAO,eAAgBM,EAAO,QAAS,QAAS,KAAM,MACtD,oBACA,kBACA,sBACA,WACA,SACA,gBACA,WACA,eACA,gBACA,WACA,gBACA,YACA,OACA,UACA,oBACA,YACA,YACAN,EAAO,SAAUuB,EAAY,MAC7B,OACA,cACA,kBACA,iCACA,WACA,oBACA,UACA,oBAIIG,EAAuB,CAC3B,MACA,0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CACE1C,UAAW,QACXoC,cAAe,uCACflC,IAAK,MACLiD,YAAY,EACZ7E,SAAUqC,EACVf,SAAU,CACRN,EAAK8D,QAAQ9D,EAAK+D,WAAY,CAC5BpD,MAAO,2CAFH,OAIHa,IAGP6B,GACAE,GACA,CACET,cAAe,SACflC,IAAK,IACLN,SAAU,GAAF,OAAOC,GACfJ,UAAW,IAEVqB,EACAC,EACAE,EA3BG,CA4BNC,EACAQ,GACGE,EACAC,EA/BG,CAgCNE,EACAG","file":"highlight/swift.js?v=6ed673d70c5cefe4a66e","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 * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] } args\n * @returns {string}\n */\nfunction either(...args) {\n const joined = '(' + 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 'associatedtype',\n 'async',\n 'await',\n /as\\?/, // operator\n /as!/, // operator\n 'as', // operator\n 'break',\n 'case',\n 'catch',\n 'class',\n 'continue',\n 'convenience', // contextual\n 'default',\n 'defer',\n 'deinit',\n 'didSet', // contextual\n 'do',\n 'dynamic', // contextual\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 'lazy', // contextual\n 'let',\n 'mutating', // contextual\n 'nonmutating', // contextual\n /open\\(set\\)/, // contextual\n 'open', // contextual\n 'operator',\n 'optional', // contextual\n 'override', // contextual\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// #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 '#warn_unqualified_access',\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.\nconst keywordAttributes = [\n 'autoclosure',\n concat(/convention\\(/, either('swift', 'block', 'c'), /\\)/),\n 'discardableResult',\n 'dynamicCallable',\n 'dynamicMemberLookup',\n 'escaping',\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 'testable',\n 'UIApplicationMain',\n 'unknown',\n 'usableFromInline'\n];\n\n// Contextual keywords used in @available and #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/** @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 {\n contains: [ 'self' ]\n }\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 className: 'keyword',\n begin: concat(/\\./, lookahead(either(...dotKeywords, ...optionalDotKeywords))),\n end: either(...dotKeywords, ...optionalDotKeywords),\n excludeBegin: true\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 = {\n variants: [\n {\n className: 'keyword',\n match: either(...REGEX_KEYWORDS, ...optionalDotKeywords)\n }\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 {\n match: operator\n },\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 };\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 {\n match: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\\\b`\n },\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n {\n match: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\\\b`\n },\n // octal-literal\n {\n match: /\\b0o([0-7]_*)+\\b/\n },\n // binary-literal\n {\n match: /\\b0b([01]_*)+\\b/\n }\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 {\n match: concat(/\\\\/, rawDelimiter, /[0\\\\tnr\"']/)\n },\n {\n match: concat(/\\\\/, rawDelimiter, /u\\{[0-9a-fA-F]{1,8}\\}/)\n }\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 // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412\n const QUOTED_IDENTIFIER = {\n match: concat(/`/, identifier, /`/)\n };\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: /(@|#)available/,\n className: \"keyword\",\n starts: {\n 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 className: 'keyword',\n match: concat(/@/, either(...keywordAttributes))\n };\n const USER_DEFINED_ATTRIBUTE = {\n className: 'meta',\n match: concat(/@/, identifier)\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 ...KEYWORD_MODES,\n ...BUILT_INS,\n ...OPERATORS,\n NUMBER,\n STRING,\n ...IDENTIFIERS,\n ...ATTRIBUTES,\n TYPE\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID362\n // Matches both the keyword func and the function title.\n // Grouping these lets us differentiate between the operator function <\n // and the start of the generic parameter clause (also <).\n const FUNC_PLUS_TITLE = {\n beginKeywords: 'func',\n contains: [\n {\n className: 'title',\n match: either(QUOTED_IDENTIFIER.match, identifier, operator),\n // Required to make sure the opening < of the generic parameter clause\n // isn't parsed as a second title.\n endsParent: true,\n relevance: 0\n },\n WHITESPACE\n ]\n };\n const GENERIC_PARAMETERS = {\n begin: /</,\n end: />/,\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 const FUNCTION = {\n className: 'function',\n match: lookahead(/\\bfunc\\b/),\n contains: [\n FUNC_PLUS_TITLE,\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 className: 'function',\n match: /\\b(subscript|init[?!]?)\\s*(?=[<(])/,\n keywords: {\n keyword: \"subscript init init? init!\",\n $pattern: /\\w+[?!]?/\n },\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 beginKeywords: 'operator',\n end: hljs.MATCH_NOTHING_RE,\n contains: [\n {\n className: 'title',\n match: operator,\n endsParent: true,\n relevance: 0\n }\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID550\n const PRECEDENCEGROUP = {\n beginKeywords: 'precedencegroup',\n end: hljs.MATCH_NOTHING_RE,\n contains: [\n {\n className: 'title',\n match: typeIdentifier,\n relevance: 0\n },\n {\n begin: /{/,\n end: /}/,\n relevance: 0,\n endsParent: true,\n keywords: [\n ...precedencegroupKeywords,\n ...literals\n ],\n contains: [ TYPE ]\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,\n INIT_SUBSCRIPT,\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n end: '\\\\{',\n excludeEnd: true,\n keywords: KEYWORDS,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/\n }),\n ...KEYWORD_MODES\n ]\n },\n OPERATOR_DECLARATION,\n PRECEDENCEGROUP,\n {\n beginKeywords: 'import',\n end: /$/,\n contains: [ ...COMMENTS ],\n relevance: 0\n },\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"],"sourceRoot":""}
\ No newline at end of file |