index.js 124 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891
  1. var Prism = require('prismjs');
  2. /* TODO
  3. Fix XML highlighting
  4. */
  5. Prism.languages.actionscript = Prism.languages.extend('javascript', {
  6. 'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,
  7. 'operator': /(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=)=?|[=~?@]/
  8. });
  9. Prism.languages.actionscript['class-name'].alias = 'function';
  10. if (Prism.languages.markup) {
  11. Prism.languages.insertBefore('actionscript', 'operator', {
  12. 'xml': {
  13. pattern: /(^|[^.])<[\s\S]*>(?=\s*($|[\r\n,.;\]})<]))/,
  14. inside: {
  15. rest: Prism.languages.markup
  16. }
  17. }
  18. });
  19. }Prism.languages.apacheconf = {
  20. 'comment': /#.*/,
  21. 'directive-inline': {
  22. pattern: /^\s*\b(AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/mi,
  23. alias: 'property'
  24. },
  25. 'directive-block': {
  26. pattern: /<\/?\b(AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i,
  27. inside: {
  28. 'directive-block': {
  29. pattern: /^<\/?\w+/,
  30. inside: {
  31. 'punctuation': /^<\/?/
  32. },
  33. alias: 'tag'
  34. },
  35. 'directive-block-parameter': {
  36. pattern: /.*[^>]/,
  37. inside: {
  38. 'punctuation': /:/,
  39. 'string': {
  40. pattern: /("|').*\1/,
  41. inside: {
  42. 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/
  43. }
  44. }
  45. },
  46. alias: 'attr-value'
  47. },
  48. 'punctuation': />/
  49. },
  50. alias: 'tag'
  51. },
  52. 'directive-flags': {
  53. pattern: /\[(\w,?)+\]/,
  54. alias: 'keyword'
  55. },
  56. 'string': {
  57. pattern: /("|').*\1/,
  58. inside: {
  59. 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/
  60. }
  61. },
  62. 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/,
  63. 'regex': /\^?.*\$|\^.*\$?/
  64. };
  65. /* TODO
  66. Add support for nested block comments...
  67. */
  68. Prism.languages.applescript = {
  69. 'comment': [
  70. /\(\*[\w\W]*?\*\)/,
  71. /--.+/,
  72. /#.+/
  73. ],
  74. 'string': /"(?:\\?.)*?"/,
  75. 'operator': [
  76. /[&=≠≤≥*+\-\/÷^]|[<>]=?/,
  77. /\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/
  78. ],
  79. 'keyword': /\b(?:about|above|after|against|and|apart from|around|as|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|continue|copy|div|does|eighth|else|end|equal|equals|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out of|over|prop|property|put|ref|reference|repeat|return|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
  80. 'class': {
  81. pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,
  82. alias: 'builtin'
  83. },
  84. 'number': /\b-?\d*\.?\d+([Ee]-?\d+)?\b/,
  85. 'punctuation': /[{}():,¬«»《》]/
  86. };Prism.languages.aspnet = Prism.languages.extend('markup', {
  87. 'page-directive tag': {
  88. pattern: /<%\s*@.*%>/i,
  89. inside: {
  90. 'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master|MasterType|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
  91. rest: Prism.languages.markup.tag.inside
  92. }
  93. },
  94. 'directive tag': {
  95. pattern: /<%.*%>/i,
  96. inside: {
  97. 'directive tag': /<%\s*?[$=%#:]{0,2}|%>/i,
  98. rest: Prism.languages.csharp
  99. }
  100. }
  101. });
  102. // match directives of attribute value foo="<% Bar %>"
  103. Prism.languages.insertBefore('inside', 'punctuation', {
  104. 'directive tag': Prism.languages.aspnet['directive tag']
  105. }, Prism.languages.aspnet.tag.inside["attr-value"]);
  106. Prism.languages.insertBefore('aspnet', 'comment', {
  107. 'asp comment': /<%--[\w\W]*?--%>/
  108. });
  109. // script runat="server" contains csharp, not javascript
  110. Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', {
  111. 'asp script': {
  112. pattern: /<script(?=.*runat=['"]?server['"]?)[\w\W]*?>[\w\W]*?<\/script>/i,
  113. inside: {
  114. tag: {
  115. pattern: /<\/?script\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/i,
  116. inside: Prism.languages.aspnet.tag.inside
  117. },
  118. rest: Prism.languages.csharp || {}
  119. }
  120. }
  121. });
  122. // Hacks to fix eager tag matching finishing too early: <script src="<% Foo.Bar %>"> => <script src="<% Foo.Bar %>
  123. if ( Prism.languages.aspnet.style ) {
  124. Prism.languages.aspnet.style.inside.tag.pattern = /<\/?style\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/i;
  125. Prism.languages.aspnet.style.inside.tag.inside = Prism.languages.aspnet.tag.inside;
  126. }
  127. if ( Prism.languages.aspnet.script ) {
  128. Prism.languages.aspnet.script.inside.tag.pattern = Prism.languages.aspnet['asp script'].inside.tag.pattern;
  129. Prism.languages.aspnet.script.inside.tag.inside = Prism.languages.aspnet.tag.inside;
  130. }// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
  131. Prism.languages.autohotkey= {
  132. 'comment': {
  133. pattern: /(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,
  134. lookbehind: true
  135. },
  136. 'string': /"(([^"\n\r]|"")*)"/m,
  137. 'function': /[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m, //function - don't use .*\) in the end bcoz string locks it
  138. 'tag': /^[ \t]*[^\s:]+?(?=:[^:])/m, //labels
  139. 'variable': /%\w+%/,
  140. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  141. 'operator': /[\+\-\*\\\/:=\?&\|<>]/,
  142. 'punctuation': /[\{}[\]\(\):]/,
  143. 'boolean': /\b(true|false)\b/,
  144. 'selector': /\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,
  145. 'constant': /\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,
  146. 'builtin': /\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,
  147. 'symbol': /\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|control|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pause|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,
  148. 'important': /#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i,
  149. 'keyword': /\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Click|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|Delete|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Exp|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|Ln|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Right|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i
  150. };Prism.languages.bash = Prism.languages.extend('clike', {
  151. 'comment': {
  152. pattern: /(^|[^"{\\])(#.*?(\r?\n|$))/,
  153. lookbehind: true
  154. },
  155. 'string': {
  156. //allow multiline string
  157. pattern: /("|')(\\?[\s\S])*?\1/,
  158. inside: {
  159. //'property' class reused for bash variables
  160. 'property': /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^\}]+\})/
  161. }
  162. },
  163. // Redefined to prevent highlighting of numbers in filenames
  164. 'number': {
  165. pattern: /([^\w\.])-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  166. lookbehind: true
  167. },
  168. // Originally based on http://ss64.com/bash/
  169. 'function': /\b(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|declare|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|echo|egrep|eject|enable|env|ethtool|eval|exec|exit|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|select|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|until|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)\b/,
  170. 'keyword': /\b(if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)\b/
  171. });
  172. Prism.languages.insertBefore('bash', 'keyword', {
  173. //'property' class reused for bash variables
  174. 'property': /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^}]+\})/
  175. });
  176. Prism.languages.insertBefore('bash', 'comment', {
  177. //shebang must be before comment, 'important' class from css reused
  178. 'important': /(^#!\s*\/bin\/bash)|(^#!\s*\/bin\/sh)/
  179. });
  180. Prism.languages.c = Prism.languages.extend('clike', {
  181. // allow for c multiline strings
  182. 'string': /("|')([^\n\\\1]|\\.|\\\r*\n)*?\1/,
  183. 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
  184. 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\//
  185. });
  186. Prism.languages.insertBefore('c', 'string', {
  187. // property class reused for macro statements
  188. 'property': {
  189. // allow for multiline macro definitions
  190. // spaces after the # character compile fine with gcc
  191. pattern: /((^|\n)\s*)#\s*[a-z]+([^\n\\]|\\.|\\\r*\n)*/i,
  192. lookbehind: true,
  193. inside: {
  194. // highlight the path of the include statement as a string
  195. 'string': {
  196. pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
  197. lookbehind: true
  198. }
  199. }
  200. }
  201. });
  202. delete Prism.languages.c['class-name'];
  203. delete Prism.languages.c['boolean'];Prism.languages.clike = {
  204. 'comment': [
  205. {
  206. pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
  207. lookbehind: true
  208. },
  209. {
  210. pattern: /(^|[^\\:])\/\/.*/,
  211. lookbehind: true
  212. }
  213. ],
  214. 'string': /("|')(\\\n|\\?.)*?\1/,
  215. 'class-name': {
  216. pattern: /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
  217. lookbehind: true,
  218. inside: {
  219. punctuation: /(\.|\\)/
  220. }
  221. },
  222. 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
  223. 'boolean': /\b(true|false)\b/,
  224. 'function': {
  225. pattern: /[a-z0-9_]+\(/i,
  226. inside: {
  227. punctuation: /\(/
  228. }
  229. },
  230. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  231. 'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,
  232. 'ignore': /&(lt|gt|amp);/i,
  233. 'punctuation': /[{}[\];(),.:]/
  234. };
  235. (function(Prism) {
  236. // Ignore comments starting with { to privilege string interpolation highlighting
  237. var comment = /#(?!\{).+/,
  238. interpolation = {
  239. pattern: /#\{[^}]+\}/,
  240. alias: 'variable'
  241. };
  242. Prism.languages.coffeescript = Prism.languages.extend('javascript', {
  243. 'comment': comment,
  244. 'string': [
  245. // Strings are multiline
  246. /'(?:\\?[\s\S])*?'/,
  247. {
  248. // Strings are multiline
  249. pattern: /"(?:\\?[\s\S])*?"/,
  250. inside: {
  251. 'interpolation': interpolation
  252. }
  253. }
  254. ],
  255. 'keyword': /\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,
  256. 'class-member': {
  257. pattern: /@(?!\d)\w+/,
  258. alias: 'variable'
  259. }
  260. });
  261. Prism.languages.insertBefore('coffeescript', 'comment', {
  262. 'multiline-comment': {
  263. pattern: /###[\s\S]+?###/,
  264. alias: 'comment'
  265. },
  266. // Block regexp can contain comments and interpolation
  267. 'block-regex': {
  268. pattern: /\/{3}[\s\S]*?\/{3}/,
  269. alias: 'regex',
  270. inside: {
  271. 'comment': comment,
  272. 'interpolation': interpolation
  273. }
  274. }
  275. });
  276. Prism.languages.insertBefore('coffeescript', 'string', {
  277. 'inline-javascript': {
  278. pattern: /`(?:\\?[\s\S])*?`/,
  279. inside: {
  280. 'delimiter': {
  281. pattern: /^`|`$/,
  282. alias: 'punctuation'
  283. },
  284. rest: Prism.languages.javascript
  285. }
  286. },
  287. // Block strings
  288. 'multiline-string': [
  289. {
  290. pattern: /'''[\s\S]*?'''/,
  291. alias: 'string'
  292. },
  293. {
  294. pattern: /"""[\s\S]*?"""/,
  295. alias: 'string',
  296. inside: {
  297. interpolation: interpolation
  298. }
  299. }
  300. ]
  301. });
  302. Prism.languages.insertBefore('coffeescript', 'keyword', {
  303. // Object property
  304. 'property': /(?!\d)\w+(?=\s*:(?!:))/
  305. });
  306. }(Prism));Prism.languages.cpp = Prism.languages.extend('c', {
  307. 'keyword': /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|delete\[\]|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|new\[\]|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
  308. 'boolean': /\b(true|false)\b/,
  309. 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/
  310. });
  311. Prism.languages.insertBefore('cpp', 'keyword', {
  312. 'class-name': {
  313. pattern: /(class\s+)[a-z0-9_]+/i,
  314. lookbehind: true
  315. }
  316. });Prism.languages.csharp = Prism.languages.extend('clike', {
  317. 'keyword': /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,
  318. 'string': /@?("|')(\\?.)*?\1/,
  319. 'preprocessor': /^\s*#.*/m,
  320. 'number': /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i
  321. });
  322. Prism.languages.css.selector = {
  323. pattern: /[^\{\}\s][^\{\}]*(?=\s*\{)/,
  324. inside: {
  325. 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
  326. 'pseudo-class': /:[-\w]+(?:\(.*\))?/,
  327. 'class': /\.[-:\.\w]+/,
  328. 'id': /#[-:\.\w]+/
  329. }
  330. };
  331. Prism.languages.insertBefore('css', 'function', {
  332. 'hexcode': /#[\da-f]{3,6}/i,
  333. 'entity': /\\[\da-f]{1,8}/i,
  334. 'number': /[\d%\.]+/
  335. });Prism.languages.css = {
  336. 'comment': /\/\*[\w\W]*?\*\//,
  337. 'atrule': {
  338. pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
  339. inside: {
  340. 'punctuation': /[;:]/
  341. }
  342. },
  343. 'url': /url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,
  344. 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/,
  345. 'string': /("|')(\\\n|\\?.)*?\1/,
  346. 'property': /(\b|\B)[\w-]+(?=\s*:)/i,
  347. 'important': /\B!important\b/i,
  348. 'punctuation': /[\{\};:]/,
  349. 'function': /[-a-z0-9]+(?=\()/i
  350. };
  351. if (Prism.languages.markup) {
  352. Prism.languages.insertBefore('markup', 'tag', {
  353. 'style': {
  354. pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i,
  355. inside: {
  356. 'tag': {
  357. pattern: /<style[\w\W]*?>|<\/style>/i,
  358. inside: Prism.languages.markup.tag.inside
  359. },
  360. rest: Prism.languages.css
  361. },
  362. alias: 'language-css'
  363. }
  364. });
  365. Prism.languages.insertBefore('inside', 'attr-value', {
  366. 'style-attr': {
  367. pattern: /\s*style=("|').*?\1/i,
  368. inside: {
  369. 'attr-name': {
  370. pattern: /^\s*style/i,
  371. inside: Prism.languages.markup.tag.inside
  372. },
  373. 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
  374. 'attr-value': {
  375. pattern: /.+/i,
  376. inside: Prism.languages.css
  377. }
  378. },
  379. alias: 'language-css'
  380. }
  381. }, Prism.languages.markup.tag);
  382. }Prism.languages.dart = Prism.languages.extend('clike', {
  383. 'string': [
  384. /r?("""|''')[\s\S]*?\1/,
  385. /r?("|')(\\?.)*?\1/
  386. ],
  387. 'keyword': [
  388. /\b(?:async|sync|yield)\*/,
  389. /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/
  390. ],
  391. 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
  392. });
  393. Prism.languages.insertBefore('dart','function',{
  394. 'metadata': {
  395. pattern: /@\w+/,
  396. alias: 'symbol'
  397. }
  398. });Prism.languages.eiffel = {
  399. 'string': [
  400. // Single-line string
  401. /"(?:%\s+%|%"|.)*?"/,
  402. // Aligned-verbatim-strings
  403. /"([^[]*)\[[\s\S]+?\]\1"/,
  404. // Non-aligned-verbatim-strings
  405. /"([^{]*)\{[\s\S]+?\}\1"/
  406. ],
  407. // (comments including quoted strings not supported)
  408. 'comment': /--.*/,
  409. // normal char | special char | char code
  410. 'char': /'(?:%'|.)+?'/,
  411. 'keyword': /\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,
  412. 'boolean': /\b(?:True|False)\b/i,
  413. 'number': [
  414. // hexa | octal | bin
  415. /\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
  416. // Decimal
  417. /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/
  418. ],
  419. 'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
  420. 'operator': /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/
  421. };
  422. Prism.languages.erlang = {
  423. 'comment': /%.+/,
  424. 'string': /"(?:\\?.)*?"/,
  425. 'quoted-function': {
  426. pattern: /'[^']+'(?=\()/,
  427. alias: 'function'
  428. },
  429. 'quoted-atom': {
  430. pattern: /'[^']+'/,
  431. alias: 'atom'
  432. },
  433. 'boolean': /\b(?:true|false)\b/,
  434. 'keyword': /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,
  435. 'number': [
  436. /\$\\?./,
  437. /\d+#[a-z0-9]+/i,
  438. /(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/
  439. ],
  440. 'function': /\b[a-z][\w@]*(?=\()/,
  441. 'variable': /(?:\b|\?)[A-Z_][\w@]*/,
  442. 'operator': [
  443. /[=\/>:]=|>=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,
  444. {
  445. pattern: /(^|(?!<).)<(?!<)/,
  446. lookbehind: true
  447. },
  448. {
  449. pattern: /(^|(?!>).)>(?!>)/,
  450. lookbehind: true
  451. }
  452. ],
  453. 'atom': /\b[a-z][\w@]*/,
  454. 'punctuation': /[()[\]{}:;,.#|]|<<|>>/
  455. };Prism.languages.fortran = {
  456. 'quoted-number': {
  457. pattern: /[BOZ](['"])[A-F0-9]+\1/i,
  458. alias: 'number'
  459. },
  460. 'string': {
  461. pattern: /(?:\w+_)?(['"])(?:\1\1|&\n(?:\s*!.+\n)?|(?!\1).)*(?:\1|&)/,
  462. inside: {
  463. 'comment': /!.*/
  464. }
  465. },
  466. 'comment': /!.*/,
  467. 'boolean': /\.(?:TRUE|FALSE)\.(?:_\w+)?/i,
  468. 'number': /(?:\b|[+-])(?:\d+(?:\.\d*)?|\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,
  469. 'keyword': [
  470. // Types
  471. /\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,
  472. // Statements
  473. /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,
  474. // END statements
  475. /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,
  476. // Others
  477. /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i
  478. ],
  479. 'operator': [
  480. /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i,
  481. {
  482. // Use lookbehind to prevent confusion with (/ /)
  483. pattern: /(^|(?!\().)\/(?!\))/,
  484. lookbehind: true
  485. }
  486. ],
  487. 'punctuation': /\(\/|\/\)|[(),;:&]/
  488. };Prism.languages.fsharp = Prism.languages.extend('clike', {
  489. 'comment': [
  490. {
  491. pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/,
  492. lookbehind: true
  493. },
  494. {
  495. pattern: /(^|[^\\:])\/\/.*/,
  496. lookbehind: true
  497. }
  498. ],
  499. 'keyword': /\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|let|let!|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|then|to|true|try|type|upcast|use|use!|val|void|when|while|with|yield|yield!|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,
  500. 'string': /@?("""|"|')((\\|\n)?.)*?\1B?/,
  501. 'preprocessor': /^\s*#.*/m,
  502. 'number': [
  503. /\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,
  504. /\b-?0b[01]+(y|uy)?\b/,
  505. /\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/,
  506. /\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/
  507. ]
  508. });Prism.languages.gherkin = {
  509. 'pystring': {
  510. pattern: /("""|''')[\s\S]+?\1/,
  511. alias: 'string'
  512. },
  513. 'comment': {
  514. pattern: /((^|\n)[ \t]*)#.*/,
  515. lookbehind: true
  516. },
  517. 'tag': {
  518. pattern: /((^|\n)[ \t]*)@.*/,
  519. lookbehind: true
  520. },
  521. 'feature': {
  522. pattern: /((^|\n)[ \t]*)(Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):([^:]+\n)*/,
  523. lookbehind: true,
  524. inside: {
  525. 'important': {
  526. pattern: /(:)[^\n]+/,
  527. lookbehind: true
  528. },
  529. keyword: /[^:\n]+:/
  530. }
  531. },
  532. 'scenario': {
  533. pattern: /((^|\n)[ \t]*)(Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\n]*/,
  534. lookbehind: true,
  535. inside: {
  536. 'important': {
  537. pattern: /(:)[^\n]*/,
  538. lookbehind: true
  539. },
  540. keyword: /[^:\n]+:/
  541. }
  542. },
  543. 'table-body': {
  544. pattern: /(\n[ \t]*\|.+\|[^\n]*)+/,
  545. lookbehind: true,
  546. inside: {
  547. 'outline': {
  548. pattern: /<[^>]+?>/,
  549. alias: 'variable'
  550. },
  551. 'td': {
  552. pattern: /[^|]+/,
  553. alias: 'string'
  554. },
  555. 'punctuation': /\|/
  556. }
  557. },
  558. 'table-head': {
  559. pattern: /(\n[ \t]*\|.+\|[^\n]*)/,
  560. inside: {
  561. 'th': {
  562. pattern: /[^|]+/,
  563. alias: 'variable'
  564. },
  565. 'punctuation': /\|/
  566. }
  567. },
  568. 'atrule': {
  569. pattern: /(\n[ \t]+)('ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa|Þá|Þa þe|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/,
  570. lookbehind: true
  571. },
  572. 'string': {
  573. pattern: /("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/,
  574. inside: {
  575. 'outline': {
  576. pattern: /<[^>]+?>/,
  577. alias: 'variable'
  578. }
  579. }
  580. },
  581. 'outline': {
  582. pattern: /<[^>]+?>/,
  583. alias: 'variable'
  584. }
  585. };
  586. Prism.languages.git = {
  587. /*
  588. * A simple one line comment like in a git status command
  589. * For instance:
  590. * $ git status
  591. * # On branch infinite-scroll
  592. * # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged,
  593. * # and have 1 and 2 different commits each, respectively.
  594. * nothing to commit (working directory clean)
  595. */
  596. 'comment': /^#.*$/m,
  597. /*
  598. * a string (double and simple quote)
  599. */
  600. 'string': /("|')(\\?.)*?\1/m,
  601. /*
  602. * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters
  603. * For instance:
  604. * $ git add file.txt
  605. */
  606. 'command': {
  607. pattern: /^.*\$ git .*$/m,
  608. inside: {
  609. /*
  610. * A git command can contain a parameter starting by a single or a double dash followed by a string
  611. * For instance:
  612. * $ git diff --cached
  613. * $ git log -p
  614. */
  615. 'parameter': /\s(--|-)\w+/m
  616. }
  617. },
  618. /*
  619. * Coordinates displayed in a git diff command
  620. * For instance:
  621. * $ git diff
  622. * diff --git file.txt file.txt
  623. * index 6214953..1d54a52 100644
  624. * --- file.txt
  625. * +++ file.txt
  626. * @@ -1 +1,2 @@
  627. * -Here's my tetx file
  628. * +Here's my text file
  629. * +And this is the second line
  630. */
  631. 'coord': /^@@.*@@$/m,
  632. /*
  633. * Regexp to match the changed lines in a git diff output. Check the example above.
  634. */
  635. 'deleted': /^-(?!-).+$/m,
  636. 'inserted': /^\+(?!\+).+$/m,
  637. /*
  638. * Match a "commit [SHA1]" line in a git log output.
  639. * For instance:
  640. * $ git log
  641. * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
  642. * Author: lgiraudel
  643. * Date: Mon Feb 17 11:18:34 2014 +0100
  644. *
  645. * Add of a new line
  646. */
  647. 'commit_sha1': /^commit \w{40}$/m
  648. };
  649. Prism.languages.go = Prism.languages.extend('clike', {
  650. 'keyword': /\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
  651. 'builtin': /\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/,
  652. 'boolean': /\b(_|iota|nil|true|false)\b/,
  653. 'operator': /([(){}\[\]]|[*\/%^!]=?|\+[=+]?|-[>=-]?|\|[=|]?|>[=>]?|<(<|[=-])?|==?|&(&|=|^=?)?|\.(\.\.)?|[,;]|:=?)/,
  654. 'number': /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i,
  655. 'string': /("|'|`)(\\?.|\r|\n)*?\1/
  656. });
  657. delete Prism.languages.go['class-name'];
  658. Prism.languages.groovy = Prism.languages.extend('clike', {
  659. 'keyword': /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,
  660. 'string': /("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/,
  661. 'number': /\b0b[01_]+\b|\b0x[\da-f_]+(\.[\da-f_p\-]+)?\b|\b[\d_]+(\.[\d_]+[e]?[\d]*)?[glidf]\b|[\d_]+(\.[\d_]+)?\b/i,
  662. 'operator': {
  663. pattern: /(^|[^.])(={0,2}~|\?\.|\*?\.@|\.&|\.{1,2}(?!\.)|\.{2}<?(?=\w)|->|\?:|[-+]{1,2}|!|<=>|>{1,3}|<{1,2}|={1,2}|&{1,2}|\|{1,2}|\?|\*{1,2}|\/|\^|%)/,
  664. lookbehind: true
  665. },
  666. 'punctuation': /\.+|[{}[\];(),:$]/
  667. });
  668. Prism.languages.insertBefore('groovy', 'string', {
  669. 'shebang': {
  670. pattern: /#!.+/,
  671. alias: 'comment'
  672. }
  673. });
  674. Prism.languages.insertBefore('groovy', 'punctuation', {
  675. 'spock-block': /\b(setup|given|when|then|and|cleanup|expect|where):/
  676. });
  677. Prism.languages.insertBefore('groovy', 'function', {
  678. 'annotation': {
  679. pattern: /(^|[^.])@\w+/,
  680. lookbehind: true
  681. }
  682. });
  683. Prism.hooks.add('wrap', function(env) {
  684. if (env.language === 'groovy' && env.type === 'string') {
  685. var delimiter = env.content[0];
  686. if (delimiter != "'") {
  687. var pattern = /([^\\])(\$(\{.*?\}|[\w\.]+))/;
  688. if (delimiter === '$') {
  689. pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/;
  690. }
  691. env.content = Prism.highlight(env.content, {
  692. 'expression': {
  693. pattern: pattern,
  694. lookbehind: true,
  695. inside: Prism.languages.groovy
  696. }
  697. });
  698. env.classes.push(delimiter === '/' ? 'regex' : 'gstring');
  699. }
  700. }
  701. });
  702. /* TODO
  703. Handle multiline code after tag
  704. %foo= some |
  705. multiline |
  706. code |
  707. */
  708. (function(Prism) {
  709. Prism.languages.haml = {
  710. // Multiline stuff should appear before the rest
  711. 'multiline-comment': [
  712. {
  713. pattern: /((?:^|\n)([\t ]*))\/.*(\n\2[\t ]+.+)*/,
  714. lookbehind: true,
  715. alias: 'comment'
  716. },
  717. {
  718. pattern: /((?:^|\n)([\t ]*))-#.*(\n\2[\t ]+.+)*/,
  719. lookbehind: true,
  720. alias: 'comment'
  721. }
  722. ],
  723. 'multiline-code': [
  724. {
  725. pattern: /((?:^|\n)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(\n\2[\t ]+.*,[\t ]*)*(\n\2[\t ]+.+)/,
  726. lookbehind: true,
  727. inside: {
  728. rest: Prism.languages.ruby
  729. }
  730. },
  731. {
  732. pattern: /((?:^|\n)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(\n\2[\t ]+.*\|[\t ]*)*/,
  733. lookbehind: true,
  734. inside: {
  735. rest: Prism.languages.ruby
  736. }
  737. }
  738. ],
  739. // See at the end of the file for known filters
  740. 'filter': {
  741. pattern: /((?:^|\n)([\t ]*)):[\w-]+(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/,
  742. lookbehind: true,
  743. inside: {
  744. 'filter-name': {
  745. pattern: /^:[\w-]+/,
  746. alias: 'variable'
  747. }
  748. }
  749. },
  750. 'markup': {
  751. pattern: /((?:^|\n)[\t ]*)<.+/,
  752. lookbehind: true,
  753. inside: {
  754. rest: Prism.languages.markup
  755. }
  756. },
  757. 'doctype': {
  758. pattern: /((?:^|\n)[\t ]*)!!!(?: .+)?/,
  759. lookbehind: true
  760. },
  761. 'tag': {
  762. // Allows for one nested group of braces
  763. pattern: /((?:^|\n)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/,
  764. lookbehind: true,
  765. inside: {
  766. 'attributes': [
  767. {
  768. // Lookbehind tries to prevent interpolations for breaking it all
  769. // Allows for one nested group of braces
  770. pattern: /(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/,
  771. lookbehind: true,
  772. inside: {
  773. rest: Prism.languages.ruby
  774. }
  775. },
  776. {
  777. pattern: /\([^)]+\)/,
  778. inside: {
  779. 'attr-value': {
  780. pattern: /(=\s*)(?:"(?:\\?.)*?"|[^)\s]+)/,
  781. lookbehind: true
  782. },
  783. 'attr-name': /[\w:-]+(?=\s*!?=|\s*[,)])/,
  784. 'punctuation': /[=(),]/
  785. }
  786. },
  787. {
  788. pattern: /\[[^\]]+\]/,
  789. inside: {
  790. rest: Prism.languages.ruby
  791. }
  792. }
  793. ],
  794. 'punctuation': /[<>]/
  795. }
  796. },
  797. 'code': {
  798. pattern: /((?:^|\n)[\t ]*(?:[~-]|[&!]?=)).+/,
  799. lookbehind: true,
  800. inside: {
  801. rest: Prism.languages.ruby
  802. }
  803. },
  804. // Interpolations in plain text
  805. 'interpolation': {
  806. pattern: /#\{[^}]+\}/,
  807. inside: {
  808. 'delimiter': {
  809. pattern: /^#\{|\}$/,
  810. alias: 'punctuation'
  811. },
  812. rest: Prism.languages.ruby
  813. }
  814. },
  815. 'punctuation': {
  816. pattern: /((?:^|\n)[\t ]*)[~=\-&!]/,
  817. lookbehind: true
  818. }
  819. };
  820. var filter_pattern = '((?:^|\\n)([\\t ]*)):{{filter_name}}(\\n(?:\\2[\\t ]+.+|\\s*?(?=\\n)))+';
  821. // Non exhaustive list of available filters and associated languages
  822. var filters = [
  823. 'css',
  824. {filter:'coffee',language:'coffeescript'},
  825. 'erb',
  826. 'javascript',
  827. 'less',
  828. 'markdown',
  829. 'ruby',
  830. 'scss',
  831. 'textile'
  832. ];
  833. var all_filters = {};
  834. for (var i = 0, l = filters.length; i < l; i++) {
  835. var filter = filters[i];
  836. filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
  837. if (Prism.languages[filter.language]) {
  838. all_filters['filter-' + filter.filter] = {
  839. pattern: RegExp(filter_pattern.replace('{{filter_name}}', filter.filter)),
  840. lookbehind: true,
  841. inside: {
  842. 'filter-name': {
  843. pattern: /^:[\w-]+/,
  844. alias: 'variable'
  845. },
  846. rest: Prism.languages[filter.language]
  847. }
  848. }
  849. }
  850. }
  851. Prism.languages.insertBefore('haml', 'filter', all_filters);
  852. }(Prism));(function(Prism) {
  853. var handlebars_pattern = /\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;
  854. Prism.languages.handlebars = Prism.languages.extend('markup', {
  855. 'handlebars': {
  856. pattern: handlebars_pattern,
  857. inside: {
  858. 'delimiter': {
  859. pattern: /^\{\{\{?|\}\}\}?$/i,
  860. alias: 'punctuation'
  861. },
  862. 'string': /(["'])(\\?.)+?\1/,
  863. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  864. 'boolean': /\b(true|false)\b/,
  865. 'block': {
  866. pattern: /^(\s*~?\s*)[#\/]\w+/i,
  867. lookbehind: true,
  868. alias: 'keyword'
  869. },
  870. 'brackets': {
  871. pattern: /\[[^\]]+\]/,
  872. inside: {
  873. punctuation: /\[|\]/,
  874. variable: /[\w\W]+/
  875. }
  876. },
  877. 'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,
  878. 'variable': /[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/
  879. }
  880. }
  881. });
  882. // Comments are inserted at top so that they can
  883. // surround markup
  884. Prism.languages.insertBefore('handlebars', 'tag', {
  885. 'handlebars-comment': {
  886. pattern: /\{\{![\w\W]*?\}\}/,
  887. alias: ['handlebars','comment']
  888. }
  889. });
  890. // Tokenize all inline Handlebars expressions that are wrapped in {{ }} or {{{ }}}
  891. // This allows for easy Handlebars + markup highlighting
  892. Prism.hooks.add('before-highlight', function(env) {
  893. if (env.language !== 'handlebars') {
  894. return;
  895. }
  896. env.tokenStack = [];
  897. env.backupCode = env.code;
  898. env.code = env.code.replace(handlebars_pattern, function(match) {
  899. env.tokenStack.push(match);
  900. return '___HANDLEBARS' + env.tokenStack.length + '___';
  901. });
  902. });
  903. // Restore env.code for other plugins (e.g. line-numbers)
  904. Prism.hooks.add('before-insert', function(env) {
  905. if (env.language === 'handlebars') {
  906. env.code = env.backupCode;
  907. delete env.backupCode;
  908. }
  909. });
  910. // Re-insert the tokens after highlighting
  911. // and highlight them with defined grammar
  912. Prism.hooks.add('after-highlight', function(env) {
  913. if (env.language !== 'handlebars') {
  914. return;
  915. }
  916. for (var i = 0, t; t = env.tokenStack[i]; i++) {
  917. env.highlightedCode = env.highlightedCode.replace('___HANDLEBARS' + (i + 1) + '___', Prism.highlight(t, env.grammar, 'handlebars'));
  918. }
  919. env.element.innerHTML = env.highlightedCode;
  920. });
  921. }(Prism));
  922. Prism.languages.haskell= {
  923. 'comment': {
  924. pattern: /(^|[^-!#$%*+=\?&@|~.:<>^\\])(--[^-!#$%*+=\?&@|~.:<>^\\].*(\r?\n|$)|{-[\w\W]*?-})/m,
  925. lookbehind: true
  926. },
  927. 'char': /'([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,
  928. 'string': /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,
  929. 'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,
  930. 'import_statement' : {
  931. // The imported or hidden names are not included in this import
  932. // statement. This is because we want to highlight those exactly like
  933. // we do for the names in the program.
  934. pattern: /(\n|^)\s*(import)\s+(qualified\s+)?(([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)(\s+(as)\s+(([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*))?(\s+hiding\b)?/m,
  935. inside: {
  936. 'keyword': /\b(import|qualified|as|hiding)\b/
  937. }
  938. },
  939. // These are builtin variables only. Constructors are highlighted later as a constant.
  940. 'builtin': /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,
  941. // decimal integers and floating point numbers | octal integers | hexadecimal integers
  942. 'number' : /\b(\d+(\.\d+)?([eE][+-]?\d+)?|0[Oo][0-7]+|0[Xx][0-9a-fA-F]+)\b/,
  943. // Most of this is needed because of the meaning of a single '.'.
  944. // If it stands alone freely, it is the function composition.
  945. // It may also be a separator between a module name and an identifier => no
  946. // operator. If it comes together with other special characters it is an
  947. // operator too.
  948. 'operator' : /\s\.\s|([-!#$%*+=\?&@|~:<>^\\]*\.[-!#$%*+=\?&@|~:<>^\\]+)|([-!#$%*+=\?&@|~:<>^\\]+\.[-!#$%*+=\?&@|~:<>^\\]*)|[-!#$%*+=\?&@|~:<>^\\]+|(`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`)/,
  949. // In Haskell, nearly everything is a variable, do not highlight these.
  950. 'hvariable': /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/,
  951. 'constant': /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/,
  952. 'punctuation' : /[{}[\];(),.:]/
  953. };
  954. Prism.languages.http = {
  955. 'request-line': {
  956. pattern: /^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/,
  957. inside: {
  958. // HTTP Verb
  959. property: /^\b(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,
  960. // Path or query argument
  961. 'attr-name': /:\w+/
  962. }
  963. },
  964. 'response-status': {
  965. pattern: /^HTTP\/1.[01] [0-9]+.*/,
  966. inside: {
  967. // Status, e.g. 200 OK
  968. property: /[0-9]+[A-Z\s-]+$/i
  969. }
  970. },
  971. // HTTP header name
  972. keyword: /^[\w-]+:(?=.+)/m
  973. };
  974. // Create a mapping of Content-Type headers to language definitions
  975. var httpLanguages = {
  976. 'application/json': Prism.languages.javascript,
  977. 'application/xml': Prism.languages.markup,
  978. 'text/xml': Prism.languages.markup,
  979. 'text/html': Prism.languages.markup
  980. };
  981. // Insert each content type parser that has its associated language
  982. // currently loaded.
  983. for (var contentType in httpLanguages) {
  984. if (httpLanguages[contentType]) {
  985. var options = {};
  986. options[contentType] = {
  987. pattern: new RegExp('(content-type:\\s*' + contentType + '[\\w\\W]*?)\\n\\n[\\w\\W]*', 'i'),
  988. lookbehind: true,
  989. inside: {
  990. rest: httpLanguages[contentType]
  991. }
  992. };
  993. Prism.languages.insertBefore('http', 'keyword', options);
  994. }
  995. }
  996. Prism.languages.ini= {
  997. 'comment': /^\s*;.*$/m,
  998. 'important': /\[.*?\]/m,
  999. 'constant': /^\s*[^\s=]+?(?=[ \t]*=)/m,
  1000. 'attr-value': {
  1001. pattern: /=.*/m,
  1002. inside: {
  1003. 'punctuation': /^[=]/
  1004. }
  1005. }
  1006. };(function(Prism) {
  1007. Prism.languages.jade = {
  1008. // Multiline stuff should appear before the rest
  1009. 'multiline-comment': {
  1010. pattern: /((?:^|\n)([\t ]*))\/\/.*(\n\2[\t ]+.+)*/,
  1011. lookbehind: true,
  1012. alias: 'comment'
  1013. },
  1014. // All the tag-related part is in lookbehind
  1015. // so that it can be highlighted by the "tag" pattern
  1016. 'multiline-script': {
  1017. pattern: /((?:^|\n)([\t ]*)script\b.*\.[\t ]*)(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/,
  1018. lookbehind: true,
  1019. inside: {
  1020. rest: Prism.languages.javascript
  1021. }
  1022. },
  1023. // See at the end of the file for known filters
  1024. 'filter': {
  1025. pattern: /((?:^|\n)([\t ]*)):.+(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/,
  1026. lookbehind: true,
  1027. inside: {
  1028. 'filter-name': {
  1029. pattern: /^:[\w-]+/,
  1030. alias: 'variable'
  1031. }
  1032. }
  1033. },
  1034. 'multiline-plain-text': {
  1035. pattern: /((?:^|\n)([\t ]*)[\w\-#.]+\.[\t ]*)(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/,
  1036. lookbehind: true
  1037. },
  1038. 'markup': {
  1039. pattern: /((?:^|\n)[\t ]*)<.+/,
  1040. lookbehind: true,
  1041. inside: {
  1042. rest: Prism.languages.markup
  1043. }
  1044. },
  1045. 'comment': {
  1046. pattern: /((?:^|\n)[\t ]*)\/\/.+/,
  1047. lookbehind: true
  1048. },
  1049. 'doctype': {
  1050. pattern: /((?:^|\n)[\t ]*)doctype(?: .+)?/,
  1051. lookbehind: true
  1052. },
  1053. // This handle all conditional and loop keywords
  1054. 'flow-control': {
  1055. pattern: /((?:^|\n)[\t ]*)(?:if|unless|else|case|when|default|each|while)(?: .+)?/,
  1056. lookbehind: true,
  1057. inside: {
  1058. 'each': {
  1059. pattern: /((?:^|\n)[\t ]*)each .+? in\b/,
  1060. lookbehind: true,
  1061. inside: {
  1062. 'keyword': /\b(?:each|in)\b/,
  1063. 'punctuation': /,/
  1064. }
  1065. },
  1066. 'branch': {
  1067. pattern: /((?:^|\n)[\t ]*)(?:if|unless|else|case|when|default|while)/,
  1068. lookbehind: true,
  1069. alias: 'keyword'
  1070. },
  1071. rest: Prism.languages.javascript
  1072. }
  1073. },
  1074. 'keyword': {
  1075. pattern: /((?:^|\n)[\t ]*)(?:block|extends|include|append|prepend)\b.+/,
  1076. lookbehind: true
  1077. },
  1078. 'mixin': [
  1079. // Declaration
  1080. {
  1081. pattern: /((?:^|\n)[\t ]*)mixin .+/,
  1082. lookbehind: true,
  1083. inside: {
  1084. 'keyword': /^mixin/,
  1085. 'function': /\w+(?=\s*\(|\s*$)/,
  1086. 'punctuation': /[(),.]/
  1087. }
  1088. },
  1089. // Usage
  1090. {
  1091. pattern: /((?:^|\n)[\t ]*)\+.+/,
  1092. lookbehind: true,
  1093. inside: {
  1094. 'name': {
  1095. pattern: /^\+\w+/,
  1096. alias: 'function'
  1097. },
  1098. 'rest': Prism.languages.javascript
  1099. }
  1100. }
  1101. ],
  1102. 'script': {
  1103. pattern: /((?:^|\n)[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*) .+/,
  1104. lookbehind: true,
  1105. inside: {
  1106. rest: Prism.languages.javascript
  1107. }
  1108. },
  1109. 'plain-text': {
  1110. pattern: /((?:^|\n)[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]+).+/,
  1111. lookbehind: true
  1112. },
  1113. 'tag': {
  1114. pattern: /((?:^|\n)[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/,
  1115. lookbehind: true,
  1116. inside: {
  1117. 'attributes': [
  1118. {
  1119. pattern: /&[^(]+\([^)]+\)/,
  1120. inside: {
  1121. rest: Prism.languages.javascript
  1122. }
  1123. },
  1124. {
  1125. pattern: /\([^)]+\)/,
  1126. inside: {
  1127. 'attr-value': {
  1128. pattern: /(=\s*)(?:\{[^}]*\}|[^,)\n]+)/,
  1129. lookbehind: true,
  1130. inside: {
  1131. rest: Prism.languages.javascript
  1132. }
  1133. },
  1134. 'attr-name': /[\w-]+(?=\s*!?=|\s*[,)])/,
  1135. 'punctuation': /[!=(),]/
  1136. }
  1137. }
  1138. ],
  1139. 'punctuation': /[:]/
  1140. }
  1141. },
  1142. 'code': [
  1143. {
  1144. pattern: /((?:^|\n)[\t ]*(?:-|!?=)).+/,
  1145. lookbehind: true,
  1146. inside: {
  1147. rest: Prism.languages.javascript
  1148. }
  1149. }
  1150. ],
  1151. 'punctuation': /[.\-!=|]/
  1152. };
  1153. var filter_pattern = '((?:^|\\n)([\\t ]*)):{{filter_name}}(\\n(?:\\2[\\t ]+.+|\\s*?(?=\\n)))+';
  1154. // Non exhaustive list of available filters and associated languages
  1155. var filters = [
  1156. {filter:'atpl',language:'twig'},
  1157. {filter:'coffee',language:'coffeescript'},
  1158. 'ejs',
  1159. 'handlebars',
  1160. 'hogan',
  1161. 'less',
  1162. 'livescript',
  1163. 'markdown',
  1164. 'mustache',
  1165. 'plates',
  1166. {filter:'sass',language:'scss'},
  1167. 'stylus',
  1168. 'swig'
  1169. ];
  1170. var all_filters = {};
  1171. for (var i = 0, l = filters.length; i < l; i++) {
  1172. var filter = filters[i];
  1173. filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
  1174. if (Prism.languages[filter.language]) {
  1175. all_filters['filter-' + filter.filter] = {
  1176. pattern: RegExp(filter_pattern.replace('{{filter_name}}', filter.filter)),
  1177. lookbehind: true,
  1178. inside: {
  1179. 'filter-name': {
  1180. pattern: /^:[\w-]+/,
  1181. alias: 'variable'
  1182. },
  1183. rest: Prism.languages[filter.language]
  1184. }
  1185. }
  1186. }
  1187. }
  1188. Prism.languages.insertBefore('jade', 'filter', all_filters);
  1189. }(Prism));Prism.languages.java = Prism.languages.extend('clike', {
  1190. 'keyword': /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,
  1191. 'number': /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+[e]?[\d]*[df]\b|\b\d*\.?\d+\b/i,
  1192. 'operator': {
  1193. pattern: /(^|[^\.])(?:\+=|\+\+?|-=|--?|!=?|<{1,2}=?|>{1,3}=?|==?|&=|&&?|\|=|\|\|?|\?|\*=?|\/=?|%=?|\^=?|:|~)/m,
  1194. lookbehind: true
  1195. }
  1196. });Prism.languages.javascript = Prism.languages.extend('clike', {
  1197. 'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,
  1198. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/,
  1199. 'function': /(?!\d)[a-z0-9_$]+(?=\()/i
  1200. });
  1201. Prism.languages.insertBefore('javascript', 'keyword', {
  1202. 'regex': {
  1203. pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
  1204. lookbehind: true
  1205. }
  1206. });
  1207. if (Prism.languages.markup) {
  1208. Prism.languages.insertBefore('markup', 'tag', {
  1209. 'script': {
  1210. pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i,
  1211. inside: {
  1212. 'tag': {
  1213. pattern: /<script[\w\W]*?>|<\/script>/i,
  1214. inside: Prism.languages.markup.tag.inside
  1215. },
  1216. rest: Prism.languages.javascript
  1217. },
  1218. alias: 'language-javascript'
  1219. }
  1220. });
  1221. }
  1222. (function(Prism) {
  1223. var javascript = Prism.util.clone(Prism.languages.javascript);
  1224. Prism.languages.jsx = Prism.languages.extend('markup', javascript);
  1225. Prism.languages.jsx.tag.pattern= /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i;
  1226. Prism.languages.jsx.tag.inside['attr-value'].pattern = /=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i;
  1227. Prism.languages.insertBefore('inside', 'attr-value',{
  1228. 'script': {
  1229. pattern: /=(\{[\w\W]*?\})/i,
  1230. inside: {
  1231. 'function' : Prism.languages.javascript.function,
  1232. 'punctuation': /[={}[\];(),.:]/,
  1233. 'keyword': Prism.languages.javascript.keyword
  1234. },
  1235. 'alias': 'language-javascript'
  1236. }
  1237. }, Prism.languages.jsx.tag);
  1238. }(Prism));
  1239. Prism.languages.julia= {
  1240. 'comment': {
  1241. pattern: /(^|[^\\])#.*?(\r?\n|$)/,
  1242. lookbehind: true
  1243. },
  1244. 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/,
  1245. 'keyword' : /\b(abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|let|local|macro|module|print|println|quote|return|try|type|typealias|using|while)\b/,
  1246. 'boolean' : /\b(true|false)\b/,
  1247. 'number' : /\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
  1248. 'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/,
  1249. 'punctuation' : /[{}[\];(),.:]/
  1250. };Prism.languages.latex = {
  1251. 'comment': /%.*?(\r?\n|$)$/m,
  1252. 'string': /(\$)(\\?.)*?\1/,
  1253. 'punctuation': /[{}]/,
  1254. 'selector': /\\[a-z;,:\.]*/i
  1255. };/* FIXME :
  1256. :extend() is not handled specifically : its highlighting is buggy.
  1257. Mixin usage must be inside a ruleset to be highlighted.
  1258. At-rules (e.g. import) containing interpolations are buggy.
  1259. Detached rulesets are highlighted as at-rules.
  1260. A comment before a mixin usage prevents the latter to be properly highlighted.
  1261. */
  1262. Prism.languages.less = Prism.languages.extend('css', {
  1263. 'comment': [
  1264. /\/\*[\w\W]*?\*\//,
  1265. {
  1266. pattern: /(^|[^\\])\/\/.*/,
  1267. lookbehind: true
  1268. }
  1269. ],
  1270. 'atrule': {
  1271. pattern: /@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,
  1272. inside: {
  1273. 'punctuation': /[:()]/
  1274. }
  1275. },
  1276. // selectors and mixins are considered the same
  1277. 'selector': {
  1278. pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,
  1279. inside: {
  1280. // mixin parameters
  1281. 'variable': /@+[\w-]+/
  1282. }
  1283. },
  1284. 'property': /(\b|\B)(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,
  1285. 'punctuation': /[{}();:,]/,
  1286. 'operator': /[+\-*\/]/
  1287. });
  1288. // Invert function and punctuation positions
  1289. Prism.languages.insertBefore('less', 'punctuation', {
  1290. 'function': Prism.languages.less.function
  1291. });
  1292. Prism.languages.insertBefore('less', 'property', {
  1293. 'variable': [
  1294. // Variable declaration (the colon must be consumed!)
  1295. {
  1296. pattern: /@[\w-]+\s*:/,
  1297. inside: {
  1298. "punctuation": /:/
  1299. }
  1300. },
  1301. // Variable usage
  1302. /@@?[\w-]+/
  1303. ],
  1304. 'mixin-usage': {
  1305. pattern: /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,
  1306. lookbehind: true,
  1307. alias: 'function'
  1308. }
  1309. });
  1310. Prism.languages.lolcode = {
  1311. 'comment': [
  1312. /\bOBTW\s+[\s\S]*?\s+TLDR\b/,
  1313. /\bBTW.+/
  1314. ],
  1315. 'string': {
  1316. pattern: /"(?::.|[^"])*"/,
  1317. inside: {
  1318. 'variable': /:\{[^}]+\}/,
  1319. 'symbol': [
  1320. /:\([a-f\d]+\)/i,
  1321. /:\[[^\]]+\]/,
  1322. /:[)>o":]/
  1323. ]
  1324. }
  1325. },
  1326. 'number': /(-|\b)\d*\.?\d+/,
  1327. 'symbol': {
  1328. pattern: /(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,
  1329. lookbehind: true,
  1330. inside: {
  1331. 'keyword': /A(?=\s)/
  1332. }
  1333. },
  1334. 'label': {
  1335. pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
  1336. lookbehind: true,
  1337. alias: 'string'
  1338. },
  1339. 'function': {
  1340. pattern: /((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,
  1341. lookbehind: true
  1342. },
  1343. 'keyword': [
  1344. {
  1345. pattern: /(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,
  1346. lookbehind: true
  1347. },
  1348. /'Z(?=\s|,|$)/
  1349. ],
  1350. 'boolean': {
  1351. pattern: /(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,
  1352. lookbehind: true
  1353. },
  1354. 'variable': {
  1355. pattern: /(^|\s)(?:IT)(?=\s|,|$)/,
  1356. lookbehind: true
  1357. },
  1358. 'operator': {
  1359. pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,
  1360. lookbehind: true
  1361. },
  1362. 'punctuation': /\.{3}|\u2026|,|!/
  1363. };Prism.languages.markdown = Prism.languages.extend('markup', {});
  1364. Prism.languages.insertBefore('markdown', 'prolog', {
  1365. 'blockquote': {
  1366. // > ...
  1367. pattern: /(^|\n)>(?:[\t ]*>)*/,
  1368. lookbehind: true,
  1369. alias: 'punctuation'
  1370. },
  1371. 'code': [
  1372. {
  1373. // Prefixed by 4 spaces or 1 tab
  1374. pattern: /(^|\n)(?: {4}|\t).+/,
  1375. lookbehind: true,
  1376. alias: 'keyword'
  1377. },
  1378. {
  1379. // `code`
  1380. // ``code``
  1381. pattern: /``.+?``|`[^`\n]+`/,
  1382. alias: 'keyword'
  1383. }
  1384. ],
  1385. 'title': [
  1386. {
  1387. // title 1
  1388. // =======
  1389. // title 2
  1390. // -------
  1391. pattern: /\w+.*\n(?:==+|--+)/,
  1392. alias: 'important',
  1393. inside: {
  1394. punctuation: /==+$|--+$/
  1395. }
  1396. },
  1397. {
  1398. // # title 1
  1399. // ###### title 6
  1400. pattern: /((?:^|\n)\s*)#+.+/,
  1401. lookbehind: true,
  1402. alias: 'important',
  1403. inside: {
  1404. punctuation: /^#+|#+$/
  1405. }
  1406. }
  1407. ],
  1408. 'hr': {
  1409. // ***
  1410. // ---
  1411. // * * *
  1412. // -----------
  1413. pattern: /((?:^|\n)\s*)([*-])([\t ]*\2){2,}(?=\s*(?:\n|$))/,
  1414. lookbehind: true,
  1415. alias: 'punctuation'
  1416. },
  1417. 'list': {
  1418. // * item
  1419. // + item
  1420. // - item
  1421. // 1. item
  1422. pattern: /((?:^|\n)\s*)(?:[*+-]|\d+\.)(?=[\t ].)/,
  1423. lookbehind: true,
  1424. alias: 'punctuation'
  1425. },
  1426. 'url-reference': {
  1427. // [id]: http://example.com "Optional title"
  1428. // [id]: http://example.com 'Optional title'
  1429. // [id]: http://example.com (Optional title)
  1430. // [id]: <http://example.com> "Optional title"
  1431. pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:[^>]|\\>)+>)(?:[\t ]+(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\)))?/,
  1432. inside: {
  1433. 'variable': {
  1434. pattern: /^(!?\[)[^\]]+/,
  1435. lookbehind: true
  1436. },
  1437. 'string': /(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\))$/,
  1438. 'punctuation': /[[\]\(\)<>:]/
  1439. },
  1440. alias: 'url'
  1441. },
  1442. 'bold': {
  1443. // **strong**
  1444. // __strong__
  1445. // Allow only one line break
  1446. pattern: /(^|[^\\])(\*\*|__)(?:\n(?!\n)|.)+?\2/,
  1447. lookbehind: true,
  1448. inside: {
  1449. 'punctuation': /^\*\*|^__|\*\*\s*$|__\s*$/
  1450. }
  1451. },
  1452. 'italic': {
  1453. // *em*
  1454. // _em_
  1455. // Allow only one line break
  1456. pattern: /(^|[^\\])(?:\*(?:\n(?!\n)|.)+?\*|_(?:\n(?!\n)|.)+?_)/,
  1457. lookbehind: true,
  1458. inside: {
  1459. 'punctuation': /^[*_]|[*_]$/
  1460. }
  1461. },
  1462. 'url': {
  1463. // [example](http://example.com "Optional title")
  1464. // [example] [id]
  1465. pattern: /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:[^"]|\\")*")?\)| ?\[[^\]\n]*\])/,
  1466. inside: {
  1467. 'variable': {
  1468. pattern: /(!?\[)[^\]]+(?=\]$)/,
  1469. lookbehind: true
  1470. },
  1471. 'string': {
  1472. pattern: /"(?:[^"]|\\")*"(?=\)$)/
  1473. }
  1474. }
  1475. }
  1476. });
  1477. Prism.languages.markdown['bold'].inside['url'] = Prism.util.clone(Prism.languages.markdown['url']);
  1478. Prism.languages.markdown['italic'].inside['url'] = Prism.util.clone(Prism.languages.markdown['url']);
  1479. Prism.languages.markdown['bold'].inside['italic'] = Prism.util.clone(Prism.languages.markdown['italic']);
  1480. Prism.languages.markdown['italic'].inside['bold'] = Prism.util.clone(Prism.languages.markdown['bold']);Prism.languages.markup = {
  1481. 'comment': /<!--[\w\W]*?-->/,
  1482. 'prolog': /<\?.+?\?>/,
  1483. 'doctype': /<!DOCTYPE.+?>/,
  1484. 'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
  1485. 'tag': {
  1486. pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/i,
  1487. inside: {
  1488. 'tag': {
  1489. pattern: /^<\/?[\w:-]+/i,
  1490. inside: {
  1491. 'punctuation': /^<\/?/,
  1492. 'namespace': /^[\w-]+?:/
  1493. }
  1494. },
  1495. 'attr-value': {
  1496. pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
  1497. inside: {
  1498. 'punctuation': /=|>|"/
  1499. }
  1500. },
  1501. 'punctuation': /\/?>/,
  1502. 'attr-name': {
  1503. pattern: /[\w:-]+/,
  1504. inside: {
  1505. 'namespace': /^[\w-]+?:/
  1506. }
  1507. }
  1508. }
  1509. },
  1510. 'entity': /&#?[\da-z]{1,8};/i
  1511. };
  1512. // Plugin to make entity title show the real entity, idea by Roman Komarov
  1513. Prism.hooks.add('wrap', function(env) {
  1514. if (env.type === 'entity') {
  1515. env.attributes['title'] = env.content.replace(/&amp;/, '&');
  1516. }
  1517. });
  1518. Prism.languages.matlab = {
  1519. // We put string before comment, because of printf() patterns that contain "%"
  1520. 'string': {
  1521. pattern: /(^|\W)'(?:''|[^'\n])*'/,
  1522. lookbehind: true
  1523. },
  1524. 'comment': [
  1525. /%\{[\s\S]*?\}%/,
  1526. /%.+/
  1527. ],
  1528. // FIXME We could handle imaginary numbers as a whole
  1529. 'number': /\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/,
  1530. 'keyword': /\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,
  1531. 'function': /(?!\d)\w+(?=\s*\()/,
  1532. 'operator': /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,
  1533. 'punctuation': /\.{3}|[.,;\[\](){}!]/
  1534. };Prism.languages.nasm = {
  1535. 'comment': /;.*$/m,
  1536. 'string': /("|'|`)(\\?.)*?\1/m,
  1537. 'label': {
  1538. pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
  1539. alias: 'function'
  1540. },
  1541. 'keyword': [
  1542. /\[?BITS (16|32|64)\]?/m,
  1543. /^\s*section\s*[a-zA-Z\.]+:?/im,
  1544. /(?:extern|global)[^;]*/im,
  1545. /(?:CPU|FLOAT|DEFAULT).*$/m
  1546. ],
  1547. 'register': {
  1548. pattern: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/i,
  1549. alias: 'variable'
  1550. },
  1551. 'number': /(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i,
  1552. 'operator': /[\[\]\*+\-\/%<>=&|\$!]/m
  1553. };
  1554. /**
  1555. * Original by Jan T. Sott (http://github.com/idleberg)
  1556. *
  1557. * Includes all commands and plug-ins shipped with NSIS 3.0a2
  1558. */
  1559. Prism.languages.nsis = {
  1560. 'comment': {
  1561. pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(#|;).*?(\r?\n|$))/,
  1562. lookbehind: true
  1563. },
  1564. 'string': /("|')(\\?.)*?\1/,
  1565. 'keyword': /\b(Abort|Add(BrandingImage|Size)|AdvSplash|Allow(RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(Font|Gradient|Image)|BrandingText|BringToFront|Call(\b|InstDLL)|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(Directory|Font|ShortCut)|Delete(\b|INISec|INIStr|RegKey|RegValue)|Detail(Print|sButtonText)|Dialer|Dir(Text|Var|Verify)|EnableWindow|Enum(RegKey|RegValue)|Exch|Exec(\b|Shell|Wait)|ExpandEnvStrings|File(\b|BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)|Find(Close|First|Next|Window)|FlushINI|Get(CurInstType|CurrentAddress|DlgItem|DLLVersion|DLLVersionLocal|ErrorLevel|FileTime|FileTimeLocal|FullPathName|Function(\b|Address|End)|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(ButtonText|Colors|Dir|DirRegKey)|InstProgressFlags|Inst(Type|TypeGetText|TypeSetText)|Int(Cmp|CmpU|Fmt|Op)|IsWindow|Lang(DLL|String)|License(BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(Set|Text)|Manifest(DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(Dialogs|Exec)|NSISdl|OutFile|Page(\b|Callbacks)|Pop|Push|Quit|Read(EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(\b|End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)|SendMessage|Set(AutoClose|BrandingImage|Compress|Compressor|CompressorDictSize|CtlColors|CurInstType|DatablockOptimize|DateSave|DetailsPrint|DetailsView|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(InstDetails|UninstDetails|Window)|Silent(Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(Cmp|CmpS|Cpy|Len)|SubCaption|System|Unicode|Uninstall(ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|Write(RegStr|Uninstaller)|XPStyle)\b/,
  1566. 'property': /\b(admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(CR|CU|DD|LM|PD|U)|HKEY_(CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,
  1567. 'variable': /(\$(\(|\{)?[-_\w]+)(\)|\})?/i,
  1568. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  1569. 'operator': /[-+]{1,2}|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,
  1570. 'punctuation': /[{}[\];(),.:]/,
  1571. 'important': /!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)\b/i
  1572. };
  1573. Prism.languages.objectivec = Prism.languages.extend('c', {
  1574. 'keyword': /(\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b)|((?=[\w|@])(@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b)/,
  1575. 'string': /(?:("|')([^\n\\\1]|\\.|\\\r*\n)*?\1)|(@"([^\n\\"]|\\.|\\\r*\n)*?")/,
  1576. 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|@/
  1577. });
  1578. // Based on Free Pascal
  1579. /* TODO
  1580. Support inline asm ?
  1581. */
  1582. Prism.languages.pascal = {
  1583. 'comment': [
  1584. /\(\*[\s\S]+?\*\)/,
  1585. /\{[\s\S]+?\}/,
  1586. /\/\/.*/
  1587. ],
  1588. 'string': [
  1589. /(?:'(?:''|[^'\n])*'|#[&$%]?[a-f\d]+)+/i,
  1590. // Char
  1591. /\^[a-z]/i
  1592. ],
  1593. 'keyword': [
  1594. {
  1595. // Turbo Pascal
  1596. pattern: /(^|(?!&)[\s\S])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,
  1597. lookbehind: true
  1598. },
  1599. {
  1600. // Free Pascal
  1601. pattern: /(^|(?!&)[\s\S])\b(?:dispose|exit|false|new|true)\b/i,
  1602. lookbehind: true
  1603. },
  1604. {
  1605. // Object Pascal
  1606. pattern: /(^|(?!&)[\s\S])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,
  1607. lookbehind: true
  1608. },
  1609. {
  1610. // Modifiers
  1611. pattern: /(^|(?!&)[\s\S])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,
  1612. lookbehind: true
  1613. }
  1614. ],
  1615. 'number': [
  1616. // Hexadecimal, octal and binary
  1617. /[+-]?(?:[&%]\d+|\$[a-f\d]+)/i,
  1618. // Decimal
  1619. /([+-]|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?/i
  1620. ],
  1621. 'operator': [
  1622. /\.\.|\*\*|:=|[<>]{2}|[<>+\-*\/]=?|[@^=]/i,
  1623. {
  1624. pattern: /(^|(?!&)[\s\S])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,
  1625. lookbehind: true
  1626. }
  1627. ],
  1628. 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/
  1629. };Prism.languages.perl = {
  1630. 'comment': [
  1631. {
  1632. // POD
  1633. pattern: /((?:^|\n)\s*)=\w+[\s\S]*?=cut.*/,
  1634. lookbehind: true
  1635. },
  1636. {
  1637. pattern: /(^|[^\\$])#.*?(\r?\n|$)/,
  1638. lookbehind: true
  1639. }
  1640. ],
  1641. // TODO Could be nice to handle Heredoc too.
  1642. 'string': [
  1643. // q/.../
  1644. /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1/,
  1645. // q a...a
  1646. /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(\\?.)*?\s*\1/,
  1647. // q(...)
  1648. /\b(?:q|qq|qx|qw)\s*\(([^()]|\\.)*\s*\)/,
  1649. // q{...}
  1650. /\b(?:q|qq|qx|qw)\s*\{([^{}]|\\.)*\s*\}/,
  1651. // q[...]
  1652. /\b(?:q|qq|qx|qw)\s*\[([^[\]]|\\.)*\s*\]/,
  1653. // q<...>
  1654. /\b(?:q|qq|qx|qw)\s*<([^<>]|\\.)*\s*>/,
  1655. // "...", '...', `...`
  1656. /("|'|`)(\\?.)*?\1/
  1657. ],
  1658. 'regex': [
  1659. // m/.../
  1660. /\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1[msixpodualgc]*/,
  1661. // m a...a
  1662. /\b(?:m|qr)\s+([a-zA-Z0-9])(\\?.)*?\s*\1[msixpodualgc]*/,
  1663. // m(...)
  1664. /\b(?:m|qr)\s*\(([^()]|\\.)*\s*\)[msixpodualgc]*/,
  1665. // m{...}
  1666. /\b(?:m|qr)\s*\{([^{}]|\\.)*\s*\}[msixpodualgc]*/,
  1667. // m[...]
  1668. /\b(?:m|qr)\s*\[([^[\]]|\\.)*\s*\][msixpodualgc]*/,
  1669. // m<...>
  1670. /\b(?:m|qr)\s*<([^<>]|\\.)*\s*>[msixpodualgc]*/,
  1671. // s/.../.../
  1672. /\b(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/,
  1673. // s a...a...a
  1674. /\b(?:s|tr|y)\s+([a-zA-Z0-9])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/,
  1675. // s(...)(...)
  1676. /\b(?:s|tr|y)\s*\(([^()]|\\.)*\s*\)\s*\(\s*([^()]|\\.)*\s*\)[msixpodualgcer]*/,
  1677. // s{...}{...}
  1678. /\b(?:s|tr|y)\s*\{([^{}]|\\.)*\s*\}\s*\{\s*([^{}]|\\.)*\s*\}[msixpodualgcer]*/,
  1679. // s[...][...]
  1680. /\b(?:s|tr|y)\s*\[([^[\]]|\\.)*\s*\]\s*\[\s*([^[\]]|\\.)*\s*\][msixpodualgcer]*/,
  1681. // s<...><...>
  1682. /\b(?:s|tr|y)\s*<([^<>]|\\.)*\s*>\s*<\s*([^<>]|\\.)*\s*>[msixpodualgcer]*/,
  1683. // /.../
  1684. /\/(\[.+?]|\\.|[^\/\r\n])*\/[msixpodualgc]*(?=\s*($|[\r\n,.;})&|\-+*=~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/
  1685. ],
  1686. // FIXME Not sure about the handling of ::, ', and #
  1687. 'variable': [
  1688. // ${^POSTMATCH}
  1689. /[&*\$@%]\{\^[A-Z]+\}/,
  1690. // $^V
  1691. /[&*\$@%]\^[A-Z_]/,
  1692. // ${...}
  1693. /[&*\$@%]#?(?=\{)/,
  1694. // $foo
  1695. /[&*\$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i,
  1696. // $1
  1697. /[&*\$@%]\d+/,
  1698. // $_, @_, %!
  1699. /[\$@%][!"#\$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
  1700. ],
  1701. 'filehandle': {
  1702. // <>, <FOO>, _
  1703. pattern: /<(?!=).*>|\b_\b/,
  1704. alias: 'symbol'
  1705. },
  1706. 'vstring': {
  1707. // v1.2, 1.2.3
  1708. pattern: /v\d+(\.\d+)*|\d+(\.\d+){2,}/,
  1709. alias: 'string'
  1710. },
  1711. 'function': {
  1712. pattern: /sub [a-z0-9_]+/i,
  1713. inside: {
  1714. keyword: /sub/
  1715. }
  1716. },
  1717. 'keyword': /\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
  1718. 'number': /(\n|\b)-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee]-?\d+)?)\b/,
  1719. 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|[-+*=~\/|&]{1,2}|<=?|>=?|\.{1,3}|[!?\\^]|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b/,
  1720. 'punctuation': /[{}[\];(),:]/
  1721. };
  1722. Prism.languages.insertBefore('php', 'variable', {
  1723. 'this': /\$this/,
  1724. 'global': /\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/,
  1725. 'scope': {
  1726. pattern: /\b[\w\\]+::/,
  1727. inside: {
  1728. keyword: /(static|self|parent)/,
  1729. punctuation: /(::|\\)/
  1730. }
  1731. }
  1732. });/**
  1733. * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
  1734. * Modified by Miles Johnson: http://milesj.me
  1735. *
  1736. * Supports the following:
  1737. * - Extends clike syntax
  1738. * - Support for PHP 5.3+ (namespaces, traits, generators, etc)
  1739. * - Smarter constant and function matching
  1740. *
  1741. * Adds the following new token classes:
  1742. * constant, delimiter, variable, function, package
  1743. */
  1744. Prism.languages.php = Prism.languages.extend('clike', {
  1745. 'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,
  1746. 'constant': /\b[A-Z0-9_]{2,}\b/,
  1747. 'comment': {
  1748. pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/,
  1749. lookbehind: true
  1750. }
  1751. });
  1752. // Shell-like comments are matched after strings, because they are less
  1753. // common than strings containing hashes...
  1754. Prism.languages.insertBefore('php', 'class-name', {
  1755. 'shell-comment': {
  1756. pattern: /(^|[^\\])#.*?(\r?\n|$)/,
  1757. lookbehind: true,
  1758. alias: 'comment'
  1759. }
  1760. });
  1761. Prism.languages.insertBefore('php', 'keyword', {
  1762. 'delimiter': /(\?>|<\?php|<\?)/i,
  1763. 'variable': /(\$\w+)\b/i,
  1764. 'package': {
  1765. pattern: /(\\|namespace\s+|use\s+)[\w\\]+/,
  1766. lookbehind: true,
  1767. inside: {
  1768. punctuation: /\\/
  1769. }
  1770. }
  1771. });
  1772. // Must be defined after the function pattern
  1773. Prism.languages.insertBefore('php', 'operator', {
  1774. 'property': {
  1775. pattern: /(->)[\w]+/,
  1776. lookbehind: true
  1777. }
  1778. });
  1779. // Add HTML support of the markup language exists
  1780. if (Prism.languages.markup) {
  1781. // Tokenize all inline PHP blocks that are wrapped in <?php ?>
  1782. // This allows for easy PHP + markup highlighting
  1783. Prism.hooks.add('before-highlight', function(env) {
  1784. if (env.language !== 'php') {
  1785. return;
  1786. }
  1787. env.tokenStack = [];
  1788. env.backupCode = env.code;
  1789. env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function(match) {
  1790. env.tokenStack.push(match);
  1791. return '{{{PHP' + env.tokenStack.length + '}}}';
  1792. });
  1793. });
  1794. // Restore env.code for other plugins (e.g. line-numbers)
  1795. Prism.hooks.add('before-insert', function(env) {
  1796. if (env.language === 'php') {
  1797. env.code = env.backupCode;
  1798. delete env.backupCode;
  1799. }
  1800. });
  1801. // Re-insert the tokens after highlighting
  1802. Prism.hooks.add('after-highlight', function(env) {
  1803. if (env.language !== 'php') {
  1804. return;
  1805. }
  1806. for (var i = 0, t; t = env.tokenStack[i]; i++) {
  1807. env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php'));
  1808. }
  1809. env.element.innerHTML = env.highlightedCode;
  1810. });
  1811. // Wrap tokens in classes that are missing them
  1812. Prism.hooks.add('wrap', function(env) {
  1813. if (env.language === 'php' && env.type === 'markup') {
  1814. env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, "<span class=\"token php\">$1</span>");
  1815. }
  1816. });
  1817. // Add the rules before all others
  1818. Prism.languages.insertBefore('php', 'comment', {
  1819. 'markup': {
  1820. pattern: /<[^?]\/?(.*?)>/,
  1821. inside: Prism.languages.markup
  1822. },
  1823. 'php': /\{\{\{PHP[0-9]+\}\}\}/
  1824. });
  1825. }
  1826. Prism.languages.powershell = {
  1827. 'comment': [
  1828. {
  1829. pattern: /(^|[^`])<#[\w\W]*?#>/,
  1830. lookbehind: true
  1831. },
  1832. {
  1833. pattern: /(^|[^`])#.*?(\r?\n|$)/,
  1834. lookbehind: true
  1835. }
  1836. ],
  1837. 'string': {
  1838. pattern: /("|')(`?[\w\W])*?\1/m,
  1839. inside: {}
  1840. },
  1841. // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
  1842. 'namespace': /\[[a-z][\w\W]*?\]/i,
  1843. 'boolean': /\$(true|false)\b/i,
  1844. 'variable': /\$\w+\b/i,
  1845. // per http://technet.microsoft.com/en-us/library/hh847744.aspx
  1846. 'keyword': /\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|In|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,
  1847. // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
  1848. // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
  1849. // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
  1850. 'function': /\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-(Computer|Content|EventLog|History|Item|ItemProperty|Variable)|Compare-(Object)|Complete-(Transaction)|Connect-(PSSession)|ConvertFrom-(Csv|Json|StringData)|Convert-(Path)|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-(Process)|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-(PSSession)|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-(PSSession)|Exit-(PSSession)|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-(Object)|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-(Object)|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-(Path)|Limit-(EventLog)|Measure-(Command)|Measure-(Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-(Location)|Push-(Location)|Read-(Host)|Receive-(Job)|Receive-(PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-(ComputerMachinePassword)|Resolve-(Path)|Restart-(Computer|Service)|Restore-(Computer)|Resume-(Job|Service)|Save-(Help)|Select-(Object|String|Xml)|Send-(MailMessage)|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-(Object)|Split-(Path)|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-(Object)|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-(Command)|Unblock-(File)|Undo-(Transaction)|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData)|Update-(Help|List|TypeData)|Use-(Transaction)|Wait-(Event|Job|Process)|Where-(Object)|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)|ac|cat|cd|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i,
  1851. 'operator': {
  1852. pattern: /(\W)-(and|x?or|not|eq|ne|gt|ge|lt|le|Like|(Not)?(Like|Match|Contains|In)|Replace)\b/i,
  1853. lookbehind: true
  1854. },
  1855. 'punctuation': /[|{}[\];(),.]/
  1856. };
  1857. // Variable interpolation inside strings
  1858. Prism.languages.powershell.string.inside.boolean = Prism.languages.powershell.boolean;
  1859. Prism.languages.powershell.string.inside.variable = Prism.languages.powershell.variable;Prism.languages.python= {
  1860. 'comment': {
  1861. pattern: /(^|[^\\])#.*?(\r?\n|$)/,
  1862. lookbehind: true
  1863. },
  1864. 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/,
  1865. 'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,
  1866. 'boolean' : /\b(True|False)\b/,
  1867. 'number' : /\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
  1868. 'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/,
  1869. 'punctuation' : /[{}[\];(),.:]/
  1870. };
  1871. Prism.languages.r = {
  1872. 'comment': /#.+/,
  1873. 'string': /(['"])(?:\\?.)*?\1/,
  1874. 'percent-operator': {
  1875. // Includes user-defined operators
  1876. // and %%, %*%, %/%, %in%, %o%, %x%
  1877. pattern: /%[^%]*?%/,
  1878. alias: 'operator'
  1879. },
  1880. 'boolean': /\b(?:TRUE|FALSE)\b/,
  1881. 'ellipsis': /\.\.(?:\.|\d+)/,
  1882. 'number': [
  1883. /\b(?:NaN|Inf)\b/,
  1884. /\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]??\d+)?[iL]?\b/
  1885. ],
  1886. 'keyword': /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/,
  1887. 'operator': /->>?|<?<-|[<>!=]=?|::?|&&?|\|\|?|[+\-*\/^$@~]/,
  1888. 'punctuation': /[(){}\[\],;]/
  1889. };Prism.languages.rest = {
  1890. 'table': [
  1891. {
  1892. pattern: /(\s*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1(?:[+|].+)+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/,
  1893. lookbehind: true,
  1894. inside: {
  1895. 'punctuation': /\||(?:\+[=-]+)+\+/
  1896. }
  1897. },
  1898. {
  1899. pattern: /(\s*)(?:=+ +)+=+((?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/,
  1900. lookbehind: true,
  1901. inside: {
  1902. 'punctuation': /[=-]+/
  1903. }
  1904. }
  1905. ],
  1906. // Directive-like patterns
  1907. 'substitution-def': {
  1908. pattern: /(^\s*\.\. )\|(?:[^|\s]|[^|\s][^|]*[^|\s])\| [^:]+::/m,
  1909. lookbehind: true,
  1910. inside: {
  1911. 'substitution': {
  1912. pattern: /^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,
  1913. alias: 'attr-value',
  1914. inside: {
  1915. 'punctuation': /^\||\|$/
  1916. }
  1917. },
  1918. 'directive': {
  1919. pattern: /( )[^:]+::/,
  1920. lookbehind: true,
  1921. alias: 'function',
  1922. inside: {
  1923. 'punctuation': /::$/
  1924. }
  1925. }
  1926. }
  1927. },
  1928. 'link-target': [
  1929. {
  1930. pattern: /(^\s*\.\. )\[[^\]]+\]/m,
  1931. lookbehind: true,
  1932. alias: 'string',
  1933. inside: {
  1934. 'punctuation': /^\[|\]$/
  1935. }
  1936. },
  1937. {
  1938. pattern: /(^\s*\.\. )_(?:`[^`]+`|(?:\\:|[^:])+):/m,
  1939. lookbehind: true,
  1940. alias: 'string',
  1941. inside: {
  1942. 'punctuation': /^_|:$/
  1943. }
  1944. }
  1945. ],
  1946. 'directive': {
  1947. pattern: /(^\s*\.\. )[^:]+::/m,
  1948. lookbehind: true,
  1949. alias: 'function',
  1950. inside: {
  1951. 'punctuation': /::$/
  1952. }
  1953. },
  1954. 'comment': {
  1955. pattern: /(^\s*\.\.\s).*(?:(?:\r?\n|\r).*)*?(?=(?:\r?\n|\r){2}|$)/m,
  1956. lookbehind: true
  1957. },
  1958. 'title': [
  1959. // Overlined and underlined
  1960. {
  1961. pattern: /^([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{2,})(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,
  1962. inside: {
  1963. 'punctuation': /^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,
  1964. 'important': /.+/
  1965. }
  1966. },
  1967. // Underlined only
  1968. {
  1969. pattern: /(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{2,}(?=\r?\n|\r|$)/,
  1970. lookbehind: true,
  1971. inside: {
  1972. 'punctuation': /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,
  1973. 'important': /.+/
  1974. }
  1975. }
  1976. ],
  1977. 'hr': {
  1978. pattern: /((?:\r?\n|\r){2})[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{4,}(?=(?:\r?\n|\r){2})/,
  1979. lookbehind: true,
  1980. alias: 'punctuation'
  1981. },
  1982. 'list-bullet': {
  1983. pattern: /(^\s*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,
  1984. lookbehind: true,
  1985. alias: 'punctuation'
  1986. },
  1987. 'field': {
  1988. pattern: /(^\s*):[^:]+:(?= )/m,
  1989. lookbehind: true,
  1990. alias: 'attr-name'
  1991. },
  1992. 'command-line-option': {
  1993. pattern: /(^\s*)(?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}[\S])/im,
  1994. lookbehind: true,
  1995. alias: 'symbol'
  1996. },
  1997. 'literal-block': {
  1998. pattern: /::(?:\r?\n|\r){2}([ \t]+).+(?:(?:\r?\n|\r)\1.+)*/,
  1999. inside: {
  2000. 'literal-block-punctuation': {
  2001. pattern: /^::/,
  2002. alias: 'punctuation'
  2003. }
  2004. }
  2005. },
  2006. 'quoted-literal-block': {
  2007. pattern: /::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,
  2008. inside: {
  2009. 'literal-block-punctuation': {
  2010. pattern: /^(?:::|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])/m,
  2011. alias: 'punctuation'
  2012. }
  2013. }
  2014. },
  2015. 'doctest-block': {
  2016. pattern: /(^\s*)>>> .+(?:(?:\r?\n|\r).+)*/m,
  2017. lookbehind: true,
  2018. inside: {
  2019. 'punctuation': /^>>>/
  2020. }
  2021. },
  2022. 'inline': [
  2023. {
  2024. pattern: /(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s).*?[^\s]\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,
  2025. lookbehind: true,
  2026. inside: {
  2027. 'bold': {
  2028. pattern: /(^\*\*).+(?=\*\*$)/,
  2029. lookbehind: true
  2030. },
  2031. 'italic': {
  2032. pattern: /(^\*).+(?=\*$)/,
  2033. lookbehind: true
  2034. },
  2035. 'inline-literal': {
  2036. pattern: /(^``).+(?=``$)/,
  2037. lookbehind: true,
  2038. alias: 'symbol'
  2039. },
  2040. 'role': {
  2041. pattern: /^:[^:]+:|:[^:]+:$/,
  2042. alias: 'function',
  2043. inside: {
  2044. 'punctuation': /^:|:$/
  2045. }
  2046. },
  2047. 'interpreted-text': {
  2048. pattern: /(^`).+(?=`$)/,
  2049. lookbehind: true,
  2050. alias: 'attr-value'
  2051. },
  2052. 'substitution': {
  2053. pattern: /(^\|).+(?=\|$)/,
  2054. lookbehind: true,
  2055. alias: 'attr-value'
  2056. },
  2057. 'punctuation': /\*\*?|``?|\|/
  2058. }
  2059. }
  2060. ],
  2061. 'link': [
  2062. {
  2063. pattern: /\[[^\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,
  2064. alias: 'string',
  2065. inside: {
  2066. 'punctuation': /^\[|\]_$/
  2067. }
  2068. },
  2069. {
  2070. pattern: /(?:\b[a-z\d](?:[_.:+]?[a-z\d]+)?_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
  2071. alias: 'string',
  2072. inside: {
  2073. 'punctuation': /^_?`|`?_?_$/
  2074. }
  2075. }
  2076. ],
  2077. // Line block start,
  2078. // quote attribution,
  2079. // explicit markup start,
  2080. // and anonymous hyperlink target shortcut (__)
  2081. 'punctuation': {
  2082. pattern: /(^\s*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,
  2083. lookbehind: true
  2084. }
  2085. };Prism.languages.rip = {
  2086. 'comment': /#[^\r\n]*(\r?\n|$)/,
  2087. 'keyword': /(?:=>|->)|\b(?:class|if|else|switch|case|return|exit|try|catch|finally|raise)\b/,
  2088. 'builtin': /\b(@|System)\b/,
  2089. 'boolean': /\b(true|false)\b/,
  2090. 'date': /\b\d{4}-\d{2}-\d{2}\b/,
  2091. 'time': /\b\d{2}:\d{2}:\d{2}\b/,
  2092. 'datetime': /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,
  2093. 'number': /[+-]?(?:(?:\d+\.\d+)|(?:\d+))/,
  2094. 'character': /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
  2095. 'regex': {
  2096. pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/(?=\s*($|[\r\n,.;})]))/,
  2097. lookbehind: true
  2098. },
  2099. 'symbol': /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
  2100. 'string': /("|')(\\?.)*?\1/,
  2101. 'punctuation': /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,
  2102. 'reference': /[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/
  2103. };
  2104. /**
  2105. * Original by Samuel Flores
  2106. *
  2107. * Adds the following new token classes:
  2108. * constant, builtin, variable, symbol, regex
  2109. */
  2110. Prism.languages.ruby = Prism.languages.extend('clike', {
  2111. 'comment': /#[^\r\n]*(\r?\n|$)/,
  2112. 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/,
  2113. 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
  2114. 'constant': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/
  2115. });
  2116. Prism.languages.insertBefore('ruby', 'keyword', {
  2117. 'regex': {
  2118. pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
  2119. lookbehind: true
  2120. },
  2121. 'variable': /[@$]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/,
  2122. 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/
  2123. });
  2124. /* TODO
  2125. Add support for Markdown notation inside doc comments
  2126. Add support for nested block comments...
  2127. Match closure params even when not followed by dash or brace
  2128. Add better support for macro definition
  2129. */
  2130. Prism.languages.rust = {
  2131. 'comment': [
  2132. {
  2133. pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
  2134. lookbehind: true
  2135. },
  2136. {
  2137. pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/,
  2138. lookbehind: true
  2139. }
  2140. ],
  2141. 'string': [
  2142. /b?r(#*)"(?:\\?.)*?"\1/,
  2143. /b?("|')(?:\\?.)*?\1/
  2144. ],
  2145. 'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/,
  2146. 'attribute': {
  2147. pattern: /#!?\[.+?\]/,
  2148. alias: 'attr-name'
  2149. },
  2150. 'function': [
  2151. /[a-z0-9_]+(?=\s*\()/i,
  2152. // Macros can use parens or brackets
  2153. /[a-z0-9_]+!(?=\s*\(|\[)/i
  2154. ],
  2155. 'macro-rules': {
  2156. pattern: /[a-z0-9_]+!/i,
  2157. alias: 'function'
  2158. },
  2159. // Hex, oct, bin, dec numbers with visual separators and type suffix
  2160. 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32)?|f32|f64))?\b/,
  2161. // Closure params should not be confused with bitwise OR |
  2162. 'closure-params': {
  2163. pattern: /\|[^|]*\|(?=\s*[{-])/,
  2164. inside: {
  2165. 'punctuation': /[\|:,]/,
  2166. 'operator': /[&*]/
  2167. }
  2168. },
  2169. 'punctuation': /[{}[\];(),.:]|->/,
  2170. 'operator': /[-+]{1,2}|!=?|<=?|>=?|={1,3}|&&?|\|\|?|\*|\/|\^|%|<<|>>@/
  2171. };Prism.languages.sas = {
  2172. 'datalines': {
  2173. pattern: /(^|[\r\n])\s*(?:(?:data)?lines|cards);[\s\S]+?[\r\n];/i,
  2174. lookbehind: true,
  2175. inside: {
  2176. 'keyword': {
  2177. pattern: /^(\s*)(?:(?:data)?lines|cards)/i,
  2178. lookbehind: true
  2179. },
  2180. 'punctuation': /;/,
  2181. 'data': {
  2182. pattern: /[\s\S]+/,
  2183. alias: 'string'
  2184. }
  2185. }
  2186. },
  2187. 'comment': [
  2188. {
  2189. pattern: /(^\s*|;\s*)\*.*;/m,
  2190. lookbehind: true
  2191. },
  2192. /\/\*[\s\S]+?\*\//
  2193. ],
  2194. 'datetime': {
  2195. // '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
  2196. pattern: /'[^']+'(?:d|d?t)\b/i,
  2197. alias: 'number'
  2198. },
  2199. 'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
  2200. 'keyword': /\b(?:data|else|format|if|input|proc|run|then)\b/i,
  2201. // Decimal (1.2e23), hexadecimal (0c1x)
  2202. 'number': /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,
  2203. 'operator': /\*\*|\|\||!!|¦¦|<>|><|[~¬^<>]?=|[*\/+\-<>&\|!¦~¬^]|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
  2204. 'punctuation': /[$%@.(){}\[\];,\\]/
  2205. };Prism.languages.scala = Prism.languages.extend('java', {
  2206. 'keyword': /(<-|=>)|\b(abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,
  2207. 'builtin': /\b(String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,
  2208. 'number': /\b0x[\da-f]*\.?[\da-f\-]+\b|\b\d*\.?\d+[e]?[\d]*[dfl]?\b/i,
  2209. 'symbol': /'([^\d\s]\w*)/,
  2210. 'string': /(""")[\W\w]*?\1|("|\/)[\W\w]*?\2|('.')/
  2211. });
  2212. delete Prism.languages.scala['class-name'];
  2213. delete Prism.languages.scala['function'];
  2214. Prism.languages.scheme = {
  2215. 'boolean' : /#(t|f){1}/,
  2216. 'comment' : /;.*/,
  2217. 'keyword' : {
  2218. pattern : /([(])(define(-syntax|-library|-values)?|(case-)?lambda|let(-values|(rec)?(\*)?)?|else|if|cond|begin|delay|delay-force|parameterize|guard|set!|(quasi-)?quote|syntax-rules)/,
  2219. lookbehind : true
  2220. },
  2221. 'builtin' : {
  2222. pattern : /([(])(cons|car|cdr|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b/,
  2223. lookbehind : true
  2224. },
  2225. 'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
  2226. 'number' : /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/,
  2227. 'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
  2228. 'function' : {
  2229. pattern : /([(])[^(\s|\))]*\s/,
  2230. lookbehind : true
  2231. },
  2232. 'punctuation' : /[()]/
  2233. };
  2234. Prism.languages.scss = Prism.languages.extend('css', {
  2235. 'comment': {
  2236. pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,
  2237. lookbehind: true
  2238. },
  2239. // aturle is just the @***, not the entire rule (to highlight var & stuffs)
  2240. // + add ability to highlight number & unit for media queries
  2241. 'atrule': /@[\w-]+(?=\s+(\(|\{|;))/i,
  2242. // url, compassified
  2243. 'url': /([-a-z]+-)*url(?=\()/i,
  2244. // CSS selector regex is not appropriate for Sass
  2245. // since there can be lot more things (var, @ directive, nesting..)
  2246. // a selector must start at the end of a property or after a brace (end of other rules or nesting)
  2247. // it can contain some caracters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
  2248. // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
  2249. // can "pass" as a selector- e.g: proper#{$erty})
  2250. // this one was ard to do, so please be careful if you edit this one :)
  2251. 'selector': /([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m
  2252. });
  2253. Prism.languages.insertBefore('scss', 'atrule', {
  2254. 'keyword': /@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i
  2255. });
  2256. Prism.languages.insertBefore('scss', 'property', {
  2257. // var and interpolated vars
  2258. 'variable': /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i
  2259. });
  2260. Prism.languages.insertBefore('scss', 'function', {
  2261. 'placeholder': /%[-_\w]+/i,
  2262. 'statement': /\B!(default|optional)\b/i,
  2263. 'boolean': /\b(true|false)\b/,
  2264. 'null': /\b(null)\b/,
  2265. 'operator': /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/
  2266. });
  2267. Prism.languages.smalltalk = {
  2268. 'comment': /"(?:""|[^"])+"/,
  2269. 'string': /'(?:''|[^'])+'/,
  2270. 'symbol': /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
  2271. 'block-arguments': {
  2272. pattern: /(\[\s*)(?=:)[^\[|]+?\|/,
  2273. lookbehind: true,
  2274. inside: {
  2275. 'variable': /:[\da-z]+/i,
  2276. 'punctuation': /\|/
  2277. }
  2278. },
  2279. 'temporary-variables': {
  2280. pattern: /\|[^|]+\|/,
  2281. inside: {
  2282. 'variable': /[\da-z]+/i,
  2283. 'punctuation': /\|/
  2284. }
  2285. },
  2286. 'keyword': /\b(?:nil|true|false|self|super|new)\b/,
  2287. 'character': {
  2288. pattern: /\$./,
  2289. alias: 'string'
  2290. },
  2291. 'number': [
  2292. /\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,
  2293. /(?:\B-|\b)\d+(?:\.\d+)?(?:e-?\d+)?/
  2294. ],
  2295. 'operator': /[:=~<>]=|~~|\/\/|\\\\|>>|[!^=<>+\-*\/&|,@]/,
  2296. 'punctuation': /[.;:?\[\](){}]/
  2297. };/* TODO
  2298. Add support for variables inside double quoted strings
  2299. Add support for {php}
  2300. */
  2301. (function(Prism) {
  2302. var smarty_pattern = /\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g;
  2303. var smarty_litteral_start = '{literal}';
  2304. var smarty_litteral_end = '{/literal}';
  2305. var smarty_litteral_mode = false;
  2306. Prism.languages.smarty = Prism.languages.extend('markup', {
  2307. 'smarty': {
  2308. pattern: smarty_pattern,
  2309. inside: {
  2310. 'delimiter': {
  2311. pattern: /^\{|\}$/i,
  2312. alias: 'punctuation'
  2313. },
  2314. 'string': /(["'])(\\?.)*?\1/,
  2315. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  2316. 'variable': [
  2317. /\$(?!\d)\w+/,
  2318. /#(?!\d)\w+#/,
  2319. {
  2320. pattern: /(\.|->)(?!\d)\w+/,
  2321. lookbehind: true
  2322. },
  2323. {
  2324. pattern: /(\[)(?!\d)\w+(?=\])/,
  2325. lookbehind: true
  2326. }
  2327. ],
  2328. 'function': [
  2329. {
  2330. pattern: /(\|\s*)@?(?!\d)\w+/,
  2331. lookbehind: true
  2332. },
  2333. /^\/?(?!\d)\w+/,
  2334. /(?!\d)\w+(?=\()/
  2335. ],
  2336. 'attr-name': {
  2337. // Value is made optional because it may have already been tokenized
  2338. pattern: /\w+\s*=\s*(?:(?!\d)\w+)?/,
  2339. inside: {
  2340. "variable": {
  2341. pattern: /(=\s*)(?!\d)\w+/,
  2342. lookbehind: true
  2343. },
  2344. "punctuation": /=/
  2345. }
  2346. },
  2347. 'punctuation': /[\[\]().,=\|:`]|\->/,
  2348. 'operator': [
  2349. /[+\-*\/%]|===?|[!<>]=?|&&|\|\|/,
  2350. /\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,
  2351. /\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/
  2352. ],
  2353. 'keyword': /\b(?:false|off|on|no|true|yes)\b/
  2354. }
  2355. }
  2356. });
  2357. // Comments are inserted at top so that they can
  2358. // surround markup
  2359. Prism.languages.insertBefore('smarty', 'tag', {
  2360. 'smarty-comment': {
  2361. pattern: /\{\*[\w\W]*?\*\}/,
  2362. alias: ['smarty','comment']
  2363. }
  2364. });
  2365. // Tokenize all inline Smarty expressions
  2366. Prism.hooks.add('before-highlight', function(env) {
  2367. if (env.language !== 'smarty') {
  2368. return;
  2369. }
  2370. env.tokenStack = [];
  2371. env.backupCode = env.code;
  2372. env.code = env.code.replace(smarty_pattern, function(match) {
  2373. // Smarty tags inside {literal} block are ignored
  2374. if(match === smarty_litteral_end) {
  2375. smarty_litteral_mode = false;
  2376. }
  2377. if(!smarty_litteral_mode) {
  2378. if(match === smarty_litteral_start) {
  2379. smarty_litteral_mode = true;
  2380. }
  2381. env.tokenStack.push(match);
  2382. return '___SMARTY' + env.tokenStack.length + '___';
  2383. }
  2384. return match;
  2385. });
  2386. });
  2387. // Restore env.code for other plugins (e.g. line-numbers)
  2388. Prism.hooks.add('before-insert', function(env) {
  2389. if (env.language === 'smarty') {
  2390. env.code = env.backupCode;
  2391. delete env.backupCode;
  2392. }
  2393. });
  2394. // Re-insert the tokens after highlighting
  2395. // and highlight them with defined grammar
  2396. Prism.hooks.add('after-highlight', function(env) {
  2397. if (env.language !== 'smarty') {
  2398. return;
  2399. }
  2400. for (var i = 0, t; t = env.tokenStack[i]; i++) {
  2401. env.highlightedCode = env.highlightedCode.replace('___SMARTY' + (i + 1) + '___', Prism.highlight(t, env.grammar, 'smarty'));
  2402. }
  2403. env.element.innerHTML = env.highlightedCode;
  2404. });
  2405. }(Prism));Prism.languages.sql= {
  2406. 'comment': {
  2407. pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|((--)|(\/\/)|#).*?(\r?\n|$))/,
  2408. lookbehind: true
  2409. },
  2410. 'string' : {
  2411. pattern: /(^|[^@])("|')(\\?[\s\S])*?\2/,
  2412. lookbehind: true
  2413. },
  2414. 'variable': /@[\w.$]+|@("|'|`)(\\?[\s\S])+?\1/,
  2415. 'function': /\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i, // Should we highlight user defined functions too?
  2416. 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALTER|ANALYZE|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADE|CASCADED|CASE|CHAIN|CHAR VARYING|CHARACTER VARYING|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATA|DATABASE|DATABASES|DATETIME|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DOUBLE PRECISION|DROP|DUMMY|DUMP|DUMPFILE|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE|ESCAPED BY|EXCEPT|EXEC|EXECUTE|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR|FOR EACH ROW|FORCE|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GEOMETRY|GEOMETRYCOLLECTION|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY|IDENTITY_INSERT|IDENTITYCOL|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEY|KEYS|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONGBLOB|LONGTEXT|MATCH|MATCHED|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|NATIONAL|NATIONAL CHAR VARYING|NATIONAL CHARACTER|NATIONAL CHARACTER VARYING|NATIONAL VARCHAR|NATURAL|NCHAR|NCHAR VARCHAR|NEXT|NO|NO SQL|NOCHECK|NOCYCLE|NONCLUSTERED|NULLIF|NUMERIC|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUT|OUTER|OUTFILE|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC|PROCEDURE|PUBLIC|PURGE|QUICK|RAISERROR|READ|READS SQL DATA|READTEXT|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURN|RETURNS|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROWCOUNT|ROWGUIDCOL|ROWS?|RTREE|RULE|SAVE|SAVEPOINT|SCHEMA|SELECT|SERIAL|SERIALIZABLE|SESSION|SESSION_USER|SET|SETUSER|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START|STARTING BY|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLE|TABLES|TABLESPACE|TEMP(?:ORARY)?|TEMPTABLE|TERMINATED BY|TEXT|TEXTSIZE|THEN|TIMESTAMP|TINYBLOB|TINYINT|TINYTEXT|TO|TOP|TRAN|TRANSACTION|TRANSACTIONS|TRIGGER|TRUNCATE|TSEQUAL|TYPE|TYPES|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARYING|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH|WITH ROLLUP|WITHIN|WORK|WRITE|WRITETEXT)\b/i,
  2417. 'boolean': /\b(?:TRUE|FALSE|NULL)\b/i,
  2418. 'number': /\b-?(0x)?\d*\.?[\da-f]+\b/,
  2419. 'operator': /\b(?:ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|IS|UNIQUE|CHARACTER SET|COLLATE|DIV|OFFSET|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b|[-+]|!|[=<>]{1,2}|(&){1,2}|\|?\||\?|\*|\//i,
  2420. 'punctuation': /[;[\]()`,.]/
  2421. };Prism.languages.stylus = {
  2422. 'comment': {
  2423. pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
  2424. lookbehind: true
  2425. },
  2426. 'keyword': /(px|r?em|ex|ch|vw|vh|vmin|vmax|deg|grad|rad|turn|m?s|k?Hz|dpi|dppx|dpcm)\b|\b(is|defined|not|isnt|and|or|unless|for|in)\b/g,
  2427. 'atrule': /@[\w-]+(?=\s+\S+)/gi,
  2428. 'url': /url\((["']?).*?\1\)/gi,
  2429. 'variable': /^\s*([\w-]+)(?=\s*[+-\\]?=)/gm,
  2430. 'string': /("|')(\\\n|\\?.)*?\1/g,
  2431. 'important': /\B!important\b/gi,
  2432. 'hexcode': /#[\da-f]{3,6}/gi,
  2433. 'entity': /\\[\da-f]{1,8}/gi,
  2434. 'number': /\d+\.?\d*%?/g,
  2435. 'selector': [
  2436. {
  2437. pattern: /::?(after|before|first-letter|first-line|selection)/g,
  2438. alias: 'pseudo-element'
  2439. },{
  2440. pattern: /:(?:active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|in-range|invalid|lang|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-of-type|only-child|optional|out-of-range|read-only|read-write|required|root|target|valid|visited)(?:\(.*\))?/g,
  2441. alias:'pseudo-class'
  2442. },{
  2443. pattern: /\[[\w-]+?\s*[*~$^|=]?(?:=\s*\S+)?\]/g,
  2444. inside: {
  2445. "attr-name":
  2446. {
  2447. pattern: /(\[)([\w-]+)(?=\s*[*~$^|=]{0,2})/g,
  2448. lookbehind: true
  2449. },
  2450. "punctuation": /\[|\]/g,
  2451. "operator": /[*~$^|=]/g,
  2452. "attr-value": {
  2453. pattern: /\S+/
  2454. },
  2455. },
  2456. alias: 'attr'
  2457. },
  2458. {
  2459. pattern: /\.[a-z-]+/i,
  2460. alias: 'class'
  2461. },
  2462. {
  2463. pattern: /#[a-z-]+/i,
  2464. alias: 'id'
  2465. },
  2466. {
  2467. pattern: /\b(html|head|title|base|link|meta|style|script|noscript|template|body|section|nav|article|aside|h[1-6]|header|footer|address|main|p|hr|pre|blockquote|ol|ul|li|dl|dt|dd|figure|figcaption|div|a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|dbo|span|br|wbr|ins|del|image|iframe|embed|object|param|video|audio|source|track|canvas|map|area|sv|math|table|caption|colgroup|col|tbody|thead|tfoot|tr|td|th|form|fieldset|legeng|label|input|button|select|datalist|optgroup|option|textarea|keygen|output|progress|meter|details|summary|menuitem|menu)\b/g,
  2468. alias: 'tag'
  2469. },
  2470. ],
  2471. 'property': [
  2472. /^\s*([a-z-]+)(?=\s+[\w\W]+|\s*:)(?!\s*\{|\r?\n)/mig,
  2473. {
  2474. pattern: /(\(\s*)([a-z-]+)(?=\s*:)/ig,
  2475. lookbehind: true
  2476. }
  2477. ],
  2478. 'function': /[-a-z0-9]+(?=\()/ig,
  2479. 'punctuation': /[\{\};:]/g,
  2480. 'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/g
  2481. }
  2482. // issues: nested multiline comments, highlighting inside string interpolations
  2483. Prism.languages.swift = Prism.languages.extend('clike', {
  2484. 'keyword': /\b(as|associativity|break|case|class|continue|convenience|default|deinit|didSet|do|dynamicType|else|enum|extension|fallthrough|final|for|func|get|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|required|return|right|safe|self|Self|set|static|struct|subscript|super|switch|Type|typealias|unowned|unowned|unsafe|var|weak|where|while|willSet|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\b/,
  2485. 'number': /\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
  2486. 'constant': /\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
  2487. 'atrule': /@\b(IBOutlet|IBDesignable|IBAction|IBInspectable|class_protocol|exported|noreturn|NSCopying|NSManaged|objc|UIApplicationMain|auto_closure)\b/,
  2488. 'builtin': /\b([A-Z]\S+|abs|advance|alignof|alignofValue|assert|contains|count|countElements|debugPrint|debugPrintln|distance|dropFirst|dropLast|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lazy|lexicographicalCompare|map|max|maxElement|min|minElement|numericCast|overlaps|partition|prefix|print|println|reduce|reflect|reverse|sizeof|sizeofValue|sort|sorted|split|startsWith|stride|strideof|strideofValue|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|withExtendedLifetime|withUnsafeMutablePointer|withUnsafeMutablePointers|withUnsafePointer|withUnsafePointers|withVaList)\b/
  2489. });
  2490. Prism.languages.twig = {
  2491. 'comment': /\{#[\s\S]*?#\}/,
  2492. 'tag': {
  2493. pattern: /(\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\})/,
  2494. inside: {
  2495. 'ld': {
  2496. pattern: /^(\{\{\-?|\{%\-?\s*\w+)/,
  2497. inside: {
  2498. 'punctuation': /^(\{\{|\{%)\-?/,
  2499. 'keyword': /\w+/
  2500. }
  2501. },
  2502. 'rd': {
  2503. pattern: /\-?(%\}|\}\})$/,
  2504. inside: {
  2505. 'punctuation': /.*/
  2506. }
  2507. },
  2508. 'string': {
  2509. pattern: /("|')(\\?.)*?\1/,
  2510. inside: {
  2511. 'punctuation': /^('|")|('|")$/
  2512. }
  2513. },
  2514. 'keyword': /\b(if)\b/,
  2515. 'boolean': /\b(true|false|null)\b/,
  2516. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
  2517. 'operator': /==|=|!=|<|>|>=|<=|\+|\-|~|\*|\/|\/\/|%|\*\*|\|/,
  2518. 'space-operator': {
  2519. pattern: /(\s)(\b(not|b\-and|b\-xor|b\-or|and|or|in|matches|starts with|ends with|is)\b|\?|:|\?:)(?=\s)/,
  2520. lookbehind: true,
  2521. inside: {
  2522. 'operator': /.*/
  2523. }
  2524. },
  2525. 'property': /\b[a-zA-Z_][a-zA-Z0-9_]*\b/,
  2526. 'punctuation': /\(|\)|\[\]|\[|\]|\{|\}|:|\.|,/
  2527. }
  2528. },
  2529. // The rest can be parsed as HTML
  2530. 'other': {
  2531. pattern: /[\s\S]*/,
  2532. inside: Prism.languages.markup
  2533. }
  2534. };
  2535. Prism.languages.typescript = Prism.languages.extend('javascript', {
  2536. 'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|module|declare|constructor|string|Function|any|number|boolean|Array|enum)\b/
  2537. });
  2538. Prism.languages.wiki = Prism.languages.extend('markup', {
  2539. 'block-comment': {
  2540. pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
  2541. lookbehind: true,
  2542. alias: 'comment'
  2543. },
  2544. 'heading': {
  2545. pattern: /^(=+).+?\1/m,
  2546. inside: {
  2547. 'punctuation': /^=+|=+$/,
  2548. 'important': /.+/
  2549. }
  2550. },
  2551. 'emphasis': {
  2552. pattern: /('{2,4}).+?\1/,
  2553. inside: {
  2554. 'bold italic': {
  2555. pattern: /('''').+?(?=\1)/,
  2556. lookbehind: true
  2557. },
  2558. 'bold': {
  2559. pattern: /(''').+?(?=\1)/,
  2560. lookbehind: true
  2561. },
  2562. 'italic': {
  2563. pattern: /('').+?(?=\1)/,
  2564. lookbehind: true
  2565. },
  2566. 'punctuation': /^''+|''+$/
  2567. }
  2568. },
  2569. 'hr': {
  2570. pattern: /^-{4,}/m,
  2571. alias: 'punctuation'
  2572. },
  2573. 'url': [
  2574. /ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b/i,
  2575. /(?:RFC|PMID) +\d+/,
  2576. /\[\[.+?\]\]/,
  2577. /\[.+?\]/
  2578. ],
  2579. 'variable': [
  2580. /__[A-Z]+__/,
  2581. /\{{3}.+?\}{3}/,
  2582. /\{\{.+?}}/
  2583. ],
  2584. 'symbol': [
  2585. /^#redirect/im,
  2586. /~{3,5}/
  2587. ],
  2588. // Handle table attrs:
  2589. // {|
  2590. // ! style="text-align:left;"| Item
  2591. // |}
  2592. 'table-tag': {
  2593. pattern: /((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,
  2594. lookbehind: true,
  2595. inside: {
  2596. 'table-bar': {
  2597. pattern: /\|$/,
  2598. alias: 'punctuation'
  2599. },
  2600. rest: Prism.languages.markup['tag'].inside
  2601. }
  2602. },
  2603. 'punctuation': /^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m
  2604. });
  2605. Prism.languages.insertBefore('wiki', 'tag', {
  2606. // Prevent highlighting inside <nowiki>, <source> and <pre> tags
  2607. 'nowiki': {
  2608. pattern: /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i,
  2609. inside: {
  2610. 'tag': {
  2611. pattern: /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(?:nowiki|pre|source)>/i,
  2612. inside: Prism.languages.markup['tag'].inside
  2613. }
  2614. }
  2615. }
  2616. });
  2617. Prism.languages.yaml = {
  2618. 'scalar': {
  2619. pattern: /([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:(\n[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,
  2620. lookbehind: true,
  2621. alias: 'string'
  2622. },
  2623. 'comment': /#[^\n]+/,
  2624. 'key': {
  2625. pattern: /(\s*[:\-,[{\n?][ \t]*(![^\s]+)?[ \t]*)[^\n{[\]},#]+?(?=\s*:\s)/,
  2626. lookbehind: true,
  2627. alias: 'atrule'
  2628. },
  2629. 'directive': {
  2630. pattern: /((^|\n)[ \t]*)%[^\n]+/,
  2631. lookbehind: true,
  2632. alias: 'important'
  2633. },
  2634. 'datetime': {
  2635. pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*(\n|$|,|]|}))/,
  2636. lookbehind: true,
  2637. alias: 'number'
  2638. },
  2639. 'boolean': {
  2640. pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=\n|$|,|]|})/i,
  2641. lookbehind: true,
  2642. alias: 'important'
  2643. },
  2644. 'null': {
  2645. pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=\n|$|,|]|})/i,
  2646. lookbehind: true,
  2647. alias: 'important'
  2648. },
  2649. 'string': {
  2650. pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')(?=[ \t]*(\n|$|,|]|}))/,
  2651. lookbehind: true
  2652. },
  2653. 'number': {
  2654. pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\dA-Fa-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=\n|$|,|]|})/i,
  2655. lookbehind: true
  2656. },
  2657. 'tag': /![^\s]+/,
  2658. 'important': /[&*][\w]+/,
  2659. 'punctuation': /([:[\]{}\-,|>?]|---|\.\.\.)/
  2660. };
  2661. Prism.languages.makefile = {
  2662. 'comment': {
  2663. pattern: /(^|[^\\])#(?:\\(?:\r\n|[\s\S])|.)*/,
  2664. lookbehind: true
  2665. },
  2666. 'string': /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  2667. // Built-in target names
  2668. 'builtin': /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,
  2669. // Targets
  2670. 'symbol': {
  2671. pattern: /^[^:=\r\n]+(?=\s*:(?!=))/m,
  2672. inside: {
  2673. 'variable': /\$+(?:[^(){}:#=\s]+|(?=[({]))/
  2674. }
  2675. },
  2676. 'variable': /\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,
  2677. 'keyword': [
  2678. // Directives
  2679. /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,
  2680. // Functions
  2681. {
  2682. pattern: /(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,
  2683. lookbehind: true
  2684. }
  2685. ],
  2686. 'operator': /(?:::|[?:+!])?=|[|@]/,
  2687. 'punctuation': /[:;(){}]/
  2688. };// https://github.com/CupOfTea696/prism
  2689. Prism.languages.json = {
  2690. 'property': /"(\b|\B)[\w-]+"(?=\s*:)/ig,
  2691. 'string': /"(?!:)(\\?[^'"])*?"(?!:)/g,
  2692. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
  2693. 'function': {
  2694. pattern: /[a-z0-9_]+\(/ig,
  2695. inside: {
  2696. punctuation: /\(/
  2697. }
  2698. },
  2699. 'punctuation': /[{}[\]);,]/g,
  2700. 'operator': /:/g,
  2701. 'boolean': /\b(true|false)\b/gi,
  2702. 'null': /\bnull\b/gi,
  2703. };
  2704. Prism.languages.jsonp = Prism.languages.json;delete Prism.languages.extend;delete Prism.languages.insertBefore;module.exports = Prism.languages;