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=52a554aafc932e0ec416","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":""}
|