diff options
Diffstat (limited to 'js/highlight/swift.js')
-rw-r--r-- | js/highlight/swift.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/highlight/swift.js b/js/highlight/swift.js index 1d646896e..20b673e53 100644 --- a/js/highlight/swift.js +++ b/js/highlight/swift.js @@ -1,2 +1,2 @@ -(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[171],{624:function(e,n,t){"use strict";function a(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,n){if(e){if("string"==typeof e)return i(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,n):void 0}}function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function o(e){return e?"string"==typeof e?e:e.source:null}function c(e){return u("(?=",e,")")}function u(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n.map((function(e){return o(e)})).join("");return a}function s(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var a="("+n.map((function(e){return o(e)})).join("|")+")";return a}var l=function(e){return u(/\b/,e,/\w$/.test(e)?/\b/:/\B/)},p=["Protocol","Type"].map(l),d=["init","self"].map(l),m=["Any","Self"],f=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],b=["false","nil","true"],y=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],F=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],v=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),w=s(v,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),g=u(v,w,"*"),A=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),E=s(A,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),N=u(A,E,"*"),C=u(/[A-Z]/,E,"*"),S=["autoclosure",u(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",u(/objc\(/,N,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],_=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];e.exports=function(e){var n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,t],o={className:"keyword",begin:u(/\./,c(s.apply(void 0,a(p).concat(a(d))))),end:s.apply(void 0,a(p).concat(a(d))),excludeBegin:!0},v={match:u(/\./,s.apply(void 0,f)),relevance:0},A=f.filter((function(e){return"string"==typeof e})).concat(["_|0"]),D=f.filter((function(e){return"string"!=typeof e})).concat(m).map(l),k={variants:[{className:"keyword",match:s.apply(void 0,a(D).concat(a(d)))}]},B={$pattern:s(/\b\w+/,/#\w+/),keyword:A.concat(h),literal:b},M=[o,v,k],x=[{match:u(/\./,s.apply(void 0,F)),relevance:0},{className:"built_in",match:u(/\b/,s.apply(void 0,F),/(?=\()/)}],I={match:/->/,relevance:0},O=[I,{className:"operator",relevance:0,variants:[{match:g},{match:"\\.(\\.|".concat(w,")+")}]}],T={className:"number",relevance:0,variants:[{match:"\\b(".concat("([0-9]_*)+",")(\\.(").concat("([0-9]_*)+","))?")+"([eE][+-]?(".concat("([0-9]_*)+","))?\\b")},{match:"\\b0x(".concat("([0-9a-fA-F]_*)+",")(\\.(").concat("([0-9a-fA-F]_*)+","))?")+"([pP][+-]?(".concat("([0-9]_*)+","))?\\b")},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{className:"subst",variants:[{match:u(/\\/,e,/[0\\tnr"']/)},{match:u(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{className:"subst",match:u(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{className:"subst",label:"interpol",begin:u(/\\/,e,/\(/),end:/\)/}},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{begin:u(e,/"""/),end:u(/"""/,e),contains:[L(e),P(e),j(e)]}},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{begin:u(e,/"/),end:u(/"/,e),contains:[L(e),j(e)]}},z={className:"string",variants:[K(),K("#"),K("##"),K("###"),$(),$("#"),$("##"),$("###")]},U={match:u(/`/,N,/`/)},q=[U,{className:"variable",match:/\$\d+/},{className:"variable",match:"\\$".concat(E,"+")}],W=[{match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_,contains:[].concat(O,[T,z])}]}},{className:"keyword",match:u(/@/,s.apply(void 0,S))},{className:"meta",match:u(/@/,N)}],Z={match:c(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:u(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,E,"+")},{className:"type",match:C,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:u(/\s+&\s+/,c(C)),relevance:0}]},G={begin:/</,end:/>/,keywords:B,contains:[].concat(i,M,W,[I,Z])};Z.contains.push(G);var H,R={begin:/\(/,end:/\)/,relevance:0,keywords:B,contains:["self",{match:u(N,/\s*:/),keywords:"_|0",relevance:0}].concat(i,M,x,O,[T,z],q,W,[Z])},V={beginKeywords:"func",contains:[{className:"title",match:s(U.match,N,g),endsParent:!0,relevance:0},n]},J={begin:/</,end:/>/,contains:[].concat(i,[Z])},X={begin:/\(/,end:/\)/,keywords:B,contains:[{begin:s(c(u(N,/\s*:/)),c(u(N,/\s+/,N,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:N}]}].concat(i,M,O,[T,z],W,[Z,R]),endsParent:!0,illegal:/["']/},Q={className:"function",match:c(/\bfunc\b/),contains:[V,J,X,n],illegal:[/\[/,/%/]},Y={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[J,X,n],illegal:/\[|%/},ee={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:g,endsParent:!0,relevance:0}]},ne={beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:C,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[].concat(y,b),contains:[Z]}]},te=function(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=r(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return c=e.done,e},e:function(e){u=!0,o=e},f:function(){try{c||null==t.return||t.return()}finally{if(u)throw o}}}}(z.variants);try{for(te.s();!(H=te.n()).done;){var ae=H.value.contains.find((function(e){return"interpol"===e.label}));ae.keywords=B;var re=[].concat(M,x,O,[T,z],q);ae.contains=[].concat(a(re),[{begin:/\(/,end:/\)/,contains:["self"].concat(a(re))}])}}catch(e){te.e(e)}finally{te.f()}return{name:"Swift",keywords:B,contains:[].concat(i,[Q,Y,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:B,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/})].concat(M)},ee,ne,{beginKeywords:"import",end:/$/,contains:[].concat(i),relevance:0}],M,x,O,[T,z],q,W,[Z,R])}}}}]); -//# sourceMappingURL=swift.js.map?v=6ed673d70c5cefe4a66e
\ No newline at end of file +(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[171],{610:function(e,n,a){"use strict";function t(e){return e?"string"==typeof e?e:e.source:null}function i(e){return s("(?=",e,")")}function s(...e){return e.map(e=>t(e)).join("")}function c(...e){return"("+e.map(e=>t(e)).join("|")+")"}const u=e=>s(/\b/,e,/\w$/.test(e)?/\b/:/\B/),o=["Protocol","Type"].map(u),r=["init","self"].map(u),l=["Any","Self"],m=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],F=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],b=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=c(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),h=c(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),w=s(f,h,"*"),y=c(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),g=c(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=s(y,g,"*"),v=s(/[A-Z]/,g,"*"),N=["autoclosure",s(/convention\(/,c("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",s(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],A=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];e.exports=function(e){const n={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),t=[e.C_LINE_COMMENT_MODE,a],f={className:"keyword",begin:s(/\./,i(c(...o,...r))),end:c(...o,...r),excludeBegin:!0},y={match:s(/\./,c(...m)),relevance:0},C=m.filter(e=>"string"==typeof e).concat(["_|0"]),_={variants:[{className:"keyword",match:c(...m.filter(e=>"string"!=typeof e).concat(l).map(u),...r)}]},D={$pattern:c(/\b\w+/,/#\w+/),keyword:C.concat(F),literal:p},k=[f,y,_],B=[{match:s(/\./,c(...b)),relevance:0},{className:"built_in",match:s(/\b/,c(...b),/(?=\()/)}],M={match:/->/,relevance:0},x=[M,{className:"operator",relevance:0,variants:[{match:w},{match:"\\.(\\.|".concat(h,")+")}]}],S={className:"number",relevance:0,variants:[{match:"\\b(".concat("([0-9]_*)+",")(\\.(").concat("([0-9]_*)+","))?")+"([eE][+-]?(".concat("([0-9]_*)+","))?\\b")},{match:"\\b0x(".concat("([0-9a-fA-F]_*)+",")(\\.(").concat("([0-9a-fA-F]_*)+","))?")+"([pP][+-]?(".concat("([0-9]_*)+","))?\\b")},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(e="")=>({className:"subst",variants:[{match:s(/\\/,e,/[0\\tnr"']/)},{match:s(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(e="")=>({className:"subst",match:s(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(e="")=>({className:"subst",label:"interpol",begin:s(/\\/,e,/\(/),end:/\)/}),L=(e="")=>({begin:s(e,/"""/),end:s(/"""/,e),contains:[I(e),O(e),T(e)]}),P=(e="")=>({begin:s(e,/"/),end:s(/"/,e),contains:[I(e),T(e)]}),K={className:"string",variants:[L(),L("#"),L("##"),L("###"),P(),P("#"),P("##"),P("###")]},$={match:s(/`/,E,/`/)},j=[$,{className:"variable",match:/\$\d+/},{className:"variable",match:"\\$".concat(g,"+")}],z=[{match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:A,contains:[...x,S,K]}]}},{className:"keyword",match:s(/@/,c(...N))},{className:"meta",match:s(/@/,E)}],q={match:i(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:s(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,g,"+")},{className:"type",match:v,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:s(/\s+&\s+/,i(v)),relevance:0}]},U={begin:/</,end:/>/,keywords:D,contains:[...t,...k,...z,M,q]};q.contains.push(U);const W={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:["self",{match:s(E,/\s*:/),keywords:"_|0",relevance:0},...t,...k,...B,...x,S,K,...j,...z,q]},Z={beginKeywords:"func",contains:[{className:"title",match:c($.match,E,w),endsParent:!0,relevance:0},n]},G={begin:/</,end:/>/,contains:[...t,q]},H={begin:/\(/,end:/\)/,keywords:D,contains:[{begin:c(i(s(E,/\s*:/)),i(s(E,/\s+/,E,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:E}]},...t,...k,...x,S,K,...z,q,W],endsParent:!0,illegal:/["']/},R={className:"function",match:i(/\bfunc\b/),contains:[Z,G,H,n],illegal:[/\[/,/%/]},V={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[G,H,n],illegal:/\[|%/},J={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:w,endsParent:!0,relevance:0}]},X={beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:v,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...d,...p],contains:[q]}]};for(const e of K.variants){const n=e.contains.find(e=>"interpol"===e.label);n.keywords=D;const a=[...k,...B,...x,S,K,...j];n.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:D,contains:[...t,R,V,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:D,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...k]},J,X,{beginKeywords:"import",end:/$/,contains:[...t],relevance:0},...k,...B,...x,S,K,...j,...z,q,W]}}}}]); +//# sourceMappingURL=swift.js.map?v=319bdc6670303351b34e
\ No newline at end of file |