Update syntax highlighting (#426)

* Update highlighted data types

* Update keywords

* Add highlight.js bundled file

* Fix types

Co-authored-by: Alexandru Matei <alexandrumatei3693@gmail.com>
This commit is contained in:
alex-matthe 2021-12-07 14:18:58 +02:00 committed by GitHub
parent e4677959f8
commit e8f381592d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 333 additions and 325 deletions

View file

@ -1,5 +1,5 @@
/*! /*!
Highlight.js v11.1.0 (git: bd548da78a) Highlight.js v11.3.1 (git: 10b322dc43)
(c) 2006-2021 Ivan Sagalaev and other contributors (c) 2006-2021 Ivan Sagalaev and other contributors
License: BSD-3-Clause License: BSD-3-Clause
*/ */
@ -39,93 +39,95 @@
addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root
;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ ;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){
return new a(this,this.options).value()}finalize(){return!0}}function g(e){ return new a(this,this.options).value()}finalize(){return!0}}function g(e){
return e?"string"==typeof e?e:e.source:null}function d(e){return u("(?=",e,")")} return e?"string"==typeof e?e:e.source:null}function u(e){return f("(?=",e,")")}
function u(...e){return e.map((e=>g(e))).join("")}function h(...e){ function d(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")}
return"("+((e=>{const t=e[e.length-1] function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{
const t=e[e.length-1]
;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} ;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}
})(e).capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}function f(e){ })(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}
return RegExp(e.toString()+"|").exec("").length-1} function b(e){return RegExp(e.toString()+"|").exec("").length-1}
const p=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./
;function b(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n ;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n
;let i=g(e),r="";for(;i.length>0;){const e=p.exec(i);if(!e){r+=i;break} ;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break}
r+=i.substring(0,e.index), r+=i.substring(0,e.index),
i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0], i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0],
"("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)} "("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)}
const m="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",_="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",x={ const _="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",x="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",N="\\b(0b[01]+)",O={
begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'", begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",
illegal:"\\n",contains:[x]},O={scope:"string",begin:'"',end:'"',illegal:"\\n", illegal:"\\n",contains:[O]},R={scope:"string",begin:'"',end:'"',illegal:"\\n",
contains:[x]},k=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t, contains:[O]},v=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t,
contains:[]},n);i.contains.push({scope:"doctag", contains:[]},n);i.contains.push({scope:"doctag",
begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0})
;const r=h("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) ;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/)
;return i.contains.push({begin:u(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i ;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i
},v=k("//","$"),R=k("/\\*","\\*/"),S=k("#","$");var M=Object.freeze({ },S=v("//","$"),M=v("/\\*","\\*/"),A=v("#","$");var j=Object.freeze({
__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:m,UNDERSCORE_IDENT_RE:E, __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:_,UNDERSCORE_IDENT_RE:w,
NUMBER_RE:_,C_NUMBER_RE:y,BINARY_NUMBER_RE:w, NUMBER_RE:y,C_NUMBER_RE:x,BINARY_NUMBER_RE:N,
RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
SHEBANG:(e={})=>{const t=/^#![ ]*\// SHEBANG:(e={})=>{const t=/^#![ ]*\//
;return e.binary&&(e.begin=u(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t, ;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t,
end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},
BACKSLASH_ESCAPE:x,APOS_STRING_MODE:N,QUOTE_STRING_MODE:O,PHRASAL_WORDS_MODE:{ BACKSLASH_ESCAPE:O,APOS_STRING_MODE:k,QUOTE_STRING_MODE:R,PHRASAL_WORDS_MODE:{
begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
},COMMENT:k,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:S, },COMMENT:v,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:M,HASH_COMMENT_MODE:A,
NUMBER_MODE:{scope:"number",begin:_,relevance:0},C_NUMBER_MODE:{scope:"number", NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number",
begin:y,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:w,relevance:0}, begin:x,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:N,relevance:0},
REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,
end:/\/[gimuy]*/,illegal:/\n/,contains:[x,{begin:/\[/,end:/\]/,relevance:0, end:/\/[gimuy]*/,illegal:/\n/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,
contains:[x]}]}]},TITLE_MODE:{scope:"title",begin:m,relevance:0}, contains:[O]}]}]},TITLE_MODE:{scope:"title",begin:_,relevance:0},
UNDERSCORE_TITLE_MODE:{scope:"title",begin:E,relevance:0},METHOD_GUARD:{ UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{
begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{
"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ "on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{
t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function A(e,t){ t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){
"."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){ "."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){
void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,t){ void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){
t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",
e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,
void 0===e.relevance&&(e.relevance=0))}function T(e,t){ void 0===e.relevance&&(e.relevance=0))}function B(e,t){
Array.isArray(e.illegal)&&(e.illegal=h(...e.illegal))}function B(e,t){ Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){
if(e.match){ if(e.match){
if(e.begin||e.end)throw Error("begin & end are not supported with match") if(e.begin||e.end)throw Error("begin & end are not supported with match")
;e.begin=e.match,delete e.match}}function D(e,t){ ;e.begin=e.match,delete e.match}}function C(e,t){
void 0===e.relevance&&(e.relevance=1)}const L=(e,t)=>{if(!e.beforeMatch)return void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return
;if(e.starts)throw Error("beforeMatch cannot be used with starts") ;if(e.starts)throw Error("beforeMatch cannot be used with starts")
;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]
})),e.keywords=n.keywords,e.begin=u(n.beforeMatch,d(n.begin)),e.starts={ })),e.keywords=n.keywords,e.begin=f(n.beforeMatch,u(n.begin)),e.starts={
relevance:0,contains:[Object.assign(n,{endsParent:!0})] relevance:0,contains:[Object.assign(n,{endsParent:!0})]
},e.relevance=0,delete n.beforeMatch },e.relevance=0,delete n.beforeMatch
},C=["of","and","for","in","not","or","if","then","parent","list","value"] },H=["of","and","for","in","not","or","if","then","parent","list","value"]
;function P(e,t,n="keyword"){const i=Object.create(null) ;function U(e,t,n="keyword"){const i=Object.create(null)
;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{ ;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{
Object.assign(i,P(e[n],t,n))})),i;function r(e,n){ Object.assign(i,U(e[n],t,n))})),i;function r(e,n){
t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|")
;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ ;i[n[0]]=[e,$(n[0],n[1])]}))}}function $(e,t){
return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const $={},H=e=>{ return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{
console.error(e)},z=(e,...t)=>{console.log("WARN: "+e,...t)},K=(e,t)=>{ console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{
$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$[`${e}/${t}`]=!0) z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)
},W=Error();function G(e,t,{key:n}){let i=0;const r=e[n],s={},o={} },X=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={}
;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=f(t[e-1]) ;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1])
;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function X(e){(e=>{ ;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{
e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,
delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={
_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope
}),(e=>{if(Array.isArray(e.begin)){ }),(e=>{if(Array.isArray(e.begin)){
if(e.skip||e.excludeBegin||e.returnBegin)throw H("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
W X
;if("object"!=typeof e.beginScope||null===e.beginScope)throw H("beginScope must be object"), ;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"),
W;G(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}})(e),(e=>{ X;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{
if(Array.isArray(e.end)){ if(Array.isArray(e.end)){
if(e.skip||e.excludeEnd||e.returnEnd)throw H("skip, excludeEnd, returnEnd not compatible with endScope: {}"), if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
W X
;if("object"!=typeof e.endScope||null===e.endScope)throw H("endScope must be object"), ;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"),
W;G(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}})(e)}function Z(e){ X;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){
function t(t,n){return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))} function t(t,n){
class n{constructor(){ return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))
}class n{constructor(){
this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
addRule(e,t){ addRule(e,t){
t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),
this.matchAt+=f(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(b(e,{joinWith:"|" ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|"
}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
;const t=this.matcherRe.exec(e);if(!t)return null ;const t=this.matcherRe.exec(e);if(!t)return null
;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n]
@ -147,160 +149,165 @@
e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r ;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r
;if(r.isCompiled)return a ;if(r.isCompiled)return a
;[j,B,X,L].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))), ;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),
r.__beforeBegin=null,[I,T,D].forEach((e=>e(r,o))),r.isCompiled=!0;let l=null r.__beforeBegin=null,[L,B,C].forEach((e=>e(r,o))),r.isCompiled=!0;let l=null
;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),
l=r.keywords.$pattern, l=r.keywords.$pattern,
delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=P(r.keywords,e.case_insensitive)), delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=U(r.keywords,e.case_insensitive)),
a.keywordPatternRe=t(l,!0), a.keywordPatternRe=t(l,!0),
o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),
r.end&&(a.endRe=t(r.end)), r.end&&(a.endRe=t(a.end)),
a.terminatorEnd=g(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)), a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),
r.illegal&&(a.illegalRe=t(r.illegal)), r.illegal&&(a.illegalRe=t(r.illegal)),
r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{ r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{
variants:null},t)))),e.cachedVariants?e.cachedVariants:F(e)?s(e,{ variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{
starts:e.starts?s(e.starts):null starts:e.starts?s(e.starts):null
}):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a) }):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a)
})),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i })),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i
;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" ;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"
}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" }))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"
}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function F(e){ }),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){
return!!e&&(e.endsWithParent||F(e.starts))}const V=r,q=s,J=Symbol("nomatch") return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{
;var Q=(e=>{const t=Object.create(null),r=Object.create(null),s=[];let o=!0 constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}
const Q=r,Y=s,ee=Symbol("nomatch");var te=(e=>{
const t=Object.create(null),r=Object.create(null),s=[];let o=!0
;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ ;const a="Could not find the language '{}', did you forget to load/include a language module?",l={
disableAutodetect:!0,name:"Plain text",contains:[]};let g={ disableAutodetect:!0,name:"Plain text",contains:[]};let g={
ignoreUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,
languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",
cssSelector:"pre code",languages:null,__emitter:c};function d(e){ cssSelector:"pre code",languages:null,__emitter:c};function b(e){
return g.noHighlightRe.test(e)}function u(e,t,n){let i="",r="" return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r=""
;"object"==typeof t?(i=e, ;"object"==typeof t?(i=e,
n=t.ignoreIllegals,r=t.language):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."), n=t.ignoreIllegals,r=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."),
K("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),
r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};w("before:highlight",s) r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};R("before:highlight",s)
;const o=s.result?s.result:h(s.language,s.code,n) ;const o=s.result?s.result:E(s.language,s.code,n)
;return o.code=s.code,w("after:highlight",o),o}function h(e,n,r,s){ ;return o.code=s.code,R("after:highlight",o),o}function E(e,n,r,s){
const l=Object.create(null);function c(){if(!k.keywords)return void R.addText(S) const l=Object.create(null);function c(){if(!k.keywords)return void v.addText(S)
;let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(S),n="" ;let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(S),n=""
;for(;t;){n+=S.substring(e,t.index) ;for(;t;){n+=S.substring(e,t.index)
;const r=x.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,k.keywords[i]);if(s){ ;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,k.keywords[i]);if(s){
const[e,i]=s const[e,i]=s
;if(R.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(M+=i),e.startsWith("_"))n+=t[0];else{ ;if(v.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(M+=i),e.startsWith("_"))n+=t[0];else{
const n=x.classNameAliases[e]||e;R.addKeyword(t[0],n)}}else n+=t[0] const n=y.classNameAliases[e]||e;v.addKeyword(t[0],n)}}else n+=t[0]
;e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(S)}var i ;e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(S)}var i
;n+=S.substr(e),R.addText(n)}function d(){null!=k.subLanguage?(()=>{ ;n+=S.substr(e),v.addText(n)}function u(){null!=k.subLanguage?(()=>{
if(""===S)return;let e=null;if("string"==typeof k.subLanguage){ if(""===S)return;let e=null;if("string"==typeof k.subLanguage){
if(!t[k.subLanguage])return void R.addText(S) if(!t[k.subLanguage])return void v.addText(S)
;e=h(k.subLanguage,S,!0,v[k.subLanguage]),v[k.subLanguage]=e._top ;e=E(k.subLanguage,S,!0,R[k.subLanguage]),R[k.subLanguage]=e._top
}else e=f(S,k.subLanguage.length?k.subLanguage:null) }else e=_(S,k.subLanguage.length?k.subLanguage:null)
;k.relevance>0&&(M+=e.relevance),R.addSublanguage(e._emitter,e.language) ;k.relevance>0&&(M+=e.relevance),v.addSublanguage(e._emitter,e.language)
})():c(),S=""}function u(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++ })():c(),S=""}function d(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++
;continue}const i=x.classNameAliases[e[n]]||e[n],r=t[n] ;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n]
;i?R.addKeyword(r,i):(S=r,c(),S=""),n++}}function p(e,t){ ;i?v.addKeyword(r,i):(S=r,c(),S=""),n++}}function h(e,t){
return e.scope&&"string"==typeof e.scope&&R.openNode(x.classNameAliases[e.scope]||e.scope), return e.scope&&"string"==typeof e.scope&&v.openNode(y.classNameAliases[e.scope]||e.scope),
e.beginScope&&(e.beginScope._wrap?(R.addKeyword(S,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), e.beginScope&&(e.beginScope._wrap?(v.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),
S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),k=Object.create(e,{parent:{ S=""):e.beginScope._multi&&(d(e.beginScope,t),S="")),k=Object.create(e,{parent:{
value:k}}),k}function b(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t) value:k}}),k}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t)
;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e) ;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e)
;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){ ;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){
for(;e.endsParent&&e.parent;)e=e.parent;return e}} for(;e.endsParent&&e.parent;)e=e.parent;return e}}
if(e.endsWithParent)return b(e.parent,t,n)}function m(e){ if(e.endsWithParent)return f(e.parent,t,n)}function p(e){
return 0===k.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function _(e){ return 0===k.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){
const t=e[0],i=n.substr(e.index),r=b(k,e,i);if(!r)return J;const s=k const t=e[0],i=n.substr(e.index),r=f(k,e,i);if(!r)return ee;const s=k
;k.endScope&&k.endScope._wrap?(d(), ;k.endScope&&k.endScope._wrap?(u(),
R.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(d(), v.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(u(),
u(k.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t), d(k.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t),
d(),s.excludeEnd&&(S=t));do{ u(),s.excludeEnd&&(S=t));do{
k.scope&&R.closeNode(),k.skip||k.subLanguage||(M+=k.relevance),k=k.parent k.scope&&v.closeNode(),k.skip||k.subLanguage||(M+=k.relevance),k=k.parent
}while(k!==r.parent);return r.starts&&p(r.starts,e),s.returnEnd?0:t.length} }while(k!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length}
let y={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0 let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return u(),0
;if("begin"===y.type&&"end"===s.type&&y.index===s.index&&""===a){ ;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){
if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`) if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`)
;throw t.languageName=e,t.badRule=y.rule,t}return 1} ;throw t.languageName=e,t.badRule=m.rule,t}return 1}
if(y=s,"begin"===s.type)return(e=>{ if(m=s,"begin"===s.type)return(e=>{
const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]] const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]]
;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return m(t) ;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t)
;return n.skip?S+=t:(n.excludeBegin&&(S+=t), ;return n.skip?S+=t:(n.excludeBegin&&(S+=t),
d(),n.returnBegin||n.excludeBegin||(S=t)),p(n,e),n.returnBegin?0:t.length})(s) u(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s)
;if("illegal"===s.type&&!r){ ;if("illegal"===s.type&&!r){
const e=Error('Illegal lexeme "'+a+'" for mode "'+(k.scope||"<unnamed>")+'"') const e=Error('Illegal lexeme "'+a+'" for mode "'+(k.scope||"<unnamed>")+'"')
;throw e.mode=k,e}if("end"===s.type){const e=_(s);if(e!==J)return e} ;throw e.mode=k,e}if("end"===s.type){const e=b(s);if(e!==ee)return e}
if("illegal"===s.type&&""===a)return 1 if("illegal"===s.type&&""===a)return 1
;if(j>1e5&&j>3*s.index)throw Error("potential infinite loop, way more iterations than matches") ;if(j>1e5&&j>3*s.index)throw Error("potential infinite loop, way more iterations than matches")
;return S+=a,a.length}const x=E(e) ;return S+=a,a.length}const y=N(e)
;if(!x)throw H(a.replace("{}",e)),Error('Unknown language: "'+e+'"') ;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"')
;const N=Z(x);let O="",k=s||N;const v={},R=new g.__emitter(g);(()=>{const e=[] ;const x=V(y);let O="",k=s||x;const R={},v=new g.__emitter(g);(()=>{const e=[]
;for(let t=k;t!==x;t=t.parent)t.scope&&e.unshift(t.scope) ;for(let t=k;t!==y;t=t.parent)t.scope&&e.unshift(t.scope)
;e.forEach((e=>R.openNode(e)))})();let S="",M=0,A=0,j=0,I=!1;try{ ;e.forEach((e=>v.openNode(e)))})();let S="",M=0,A=0,j=0,I=!1;try{
for(k.matcher.considerAll();;){ for(k.matcher.considerAll();;){
j++,I?I=!1:k.matcher.considerAll(),k.matcher.lastIndex=A j++,I?I=!1:k.matcher.considerAll(),k.matcher.lastIndex=A
;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(A,e.index),e) ;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(A,e.index),e)
;A=e.index+t}return w(n.substr(A)),R.closeAllNodes(),R.finalize(),O=R.toHTML(),{ ;A=e.index+t}return w(n.substr(A)),v.closeAllNodes(),v.finalize(),O=v.toHTML(),{
language:e,value:O,relevance:M,illegal:!1,_emitter:R,_top:k}}catch(t){ language:e,value:O,relevance:M,illegal:!1,_emitter:v,_top:k}}catch(t){
if(t.message&&t.message.includes("Illegal"))return{language:e,value:V(n), if(t.message&&t.message.includes("Illegal"))return{language:e,value:Q(n),
illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A,
context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:O},_emitter:R};if(o)return{ context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:O},_emitter:v};if(o)return{
language:e,value:V(n),illegal:!1,relevance:0,errorRaised:t,_emitter:R,_top:k} language:e,value:Q(n),illegal:!1,relevance:0,errorRaised:t,_emitter:v,_top:k}
;throw t}}function f(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{ ;throw t}}function _(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{
const t={value:V(e),illegal:!1,relevance:0,_top:l,_emitter:new g.__emitter(g)} const t={value:Q(e),illegal:!1,relevance:0,_top:l,_emitter:new g.__emitter(g)}
;return t._emitter.addText(e),t})(e),r=n.filter(E).filter(y).map((t=>h(t,e,!1))) ;return t._emitter.addText(e),t})(e),r=n.filter(N).filter(k).map((t=>E(t,e,!1)))
;r.unshift(i);const s=r.sort(((e,t)=>{ ;r.unshift(i);const s=r.sort(((e,t)=>{
if(e.relevance!==t.relevance)return t.relevance-e.relevance if(e.relevance!==t.relevance)return t.relevance-e.relevance
;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1 ;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1
;if(E(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,c=o ;if(N(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,c=o
;return c.secondBest=a,c}function p(e){let t=null;const n=(e=>{ ;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{
let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" let t=e.className+" ";t+=e.parentNode?e.parentNode.className:""
;const n=g.languageDetectRe.exec(t);if(n){const t=E(n[1]) ;const n=g.languageDetectRe.exec(t);if(n){const t=N(n[1])
;return t||(z(a.replace("{}",n[1])), ;return t||(W(a.replace("{}",n[1])),
z("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}
return t.split(/\s+/).find((e=>d(e)||E(e)))})(e);if(d(n))return return t.split(/\s+/).find((e=>b(e)||N(e)))})(e);if(b(n))return
;w("before:highlightElement",{el:e,language:n ;if(R("before:highlightElement",{el:e,language:n
}),!g.ignoreUnescapedHTML&&e.children.length>0&&(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), }),e.children.length>0&&(g.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),
console.warn("https://github.com/highlightjs/highlight.js/issues/2886"), console.warn("https://github.com/highlightjs/highlight.js/issues/2886"),
console.warn(e)),t=e;const i=t.textContent,s=n?u(i,{language:n,ignoreIllegals:!0 console.warn(e)),
}):f(i);e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML)
;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):_(i)
;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n
;e.classList.add("hljs"),e.classList.add("language-"+i) ;e.classList.add("hljs"),e.classList.add("language-"+i)
})(e,n,s.language),e.result={language:s.language,re:s.relevance, })(e,n,s.language),e.result={language:s.language,re:s.relevance,
relevance:s.relevance},s.secondBest&&(e.secondBest={ relevance:s.relevance},s.secondBest&&(e.secondBest={
language:s.secondBest.language,relevance:s.secondBest.relevance language:s.secondBest.language,relevance:s.secondBest.relevance
}),w("after:highlightElement",{el:e,result:s,text:i})}let b=!1;function m(){ }),R("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function x(){
"loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(p):b=!0 "loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0
}function E(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]} }function N(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}
function _(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ function O(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
r[e.toLowerCase()]=t}))}function y(e){const t=E(e) r[e.toLowerCase()]=t}))}function k(e){const t=N(e)
;return t&&!t.disableAutodetect}function w(e,t){const n=e;s.forEach((e=>{ ;return t&&!t.disableAutodetect}function R(e,t){const n=e;s.forEach((e=>{
e[n]&&e[n](t)}))} e[n]&&e[n](t)}))}
"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{
b&&m()}),!1),Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:m, y&&x()}),!1),Object.assign(e,{highlight:m,highlightAuto:_,highlightAll:x,
highlightElement:p, highlightElement:w,
highlightBlock:e=>(K("10.7.0","highlightBlock will be removed entirely in v12.0"), highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"),
K("10.7.0","Please use highlightElement now."),p(e)),configure:e=>{g=q(g,e)}, G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Y(g,e)},
initHighlighting:()=>{ initHighlighting:()=>{
m(),K("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, x(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},
initHighlightingOnLoad:()=>{ initHighlightingOnLoad:()=>{
m(),K("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") x(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")
},registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){ },registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){
if(H("Language definition for '{}' could not be registered.".replace("{}",n)), if(K("Language definition for '{}' could not be registered.".replace("{}",n)),
!o)throw e;H(e),r=l} !o)throw e;K(e),r=l}
r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&_(r.aliases,{ r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&O(r.aliases,{
languageName:n})},unregisterLanguage:e=>{delete t[e] languageName:n})},unregisterLanguage:e=>{delete t[e]
;for(const t of Object.keys(r))r[t]===e&&delete r[t]}, ;for(const t of Object.keys(r))r[t]===e&&delete r[t]},
listLanguages:()=>Object.keys(t),getLanguage:E,registerAliases:_, listLanguages:()=>Object.keys(t),getLanguage:N,registerAliases:O,
autoDetection:y,inherit:q,addPlugin:e=>{(e=>{ autoDetection:k,inherit:Y,addPlugin:e=>{(e=>{
e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{
e["before:highlightBlock"](Object.assign({block:t.el},t)) e["before:highlightBlock"](Object.assign({block:t.el},t))
}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{
e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)}
}),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0},e.versionString="11.1.0" }),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0
;for(const e in M)"object"==typeof M[e]&&n(M[e]);return Object.assign(e,M),e },e.versionString="11.3.1",e.regex={concat:f,lookahead:u,either:p,optional:h,
})({}),Y=Object.freeze({__proto__:null,grmr_sway:e=>{const t={ anyNumberOfTimes:d};for(const e in j)"object"==typeof j[e]&&n(j[e])
className:"title.function.invoke",relevance:0, ;return Object.assign(e,j),e})({}),ne=Object.freeze({__proto__:null,
begin:u(/\b/,/(?!let\b)/,e.IDENT_RE,d(/\s*\(/))},n="([u](8|16|32|64))?",i=[] grmr_sway:e=>{const t={className:"title.function.invoke",relevance:0,
;return{name:"Sway",aliases:["sw"],keywords:{$pattern:e.IDENT_RE+"!?", begin:f(/\b/,/(?!let\b)/,e.IDENT_RE,u(/\s*\(/))},n="([u](8|16|32|64))?";return{
type:["u8","u16","u32","u64"], name:"Sway",aliases:["sw"],keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["as","asm","contract","deref","enum","fn","impl","let","library","match","mut","predicate","ref","return","script","Self","self","str","struct","trait","use","where","while"], keyword:["abi","as","asm","const","contract","deref","enum","fn","if","impl","let","library","match","mut","else","predicate","ref","return","script","Self","self","str","struct","trait","use","where","while"],
literal:["true","false"],built_in:i},illegal:"</", literal:["true","false"],
contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"] built_in:["bool","char","u8","u16","u32","u64","u128","b256","b512","str","Self"]
}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{ },illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{
contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{
className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{ className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{
begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol", begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",
begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{ begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{
@ -308,14 +315,15 @@
begin:"\\b0x([A-Fa-f0-9_]+)"+n},{ begin:"\\b0x([A-Fa-f0-9_]+)"+n},{
begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{ begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{
begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword", begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",
3:"title.function"}},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE], 3:"title.function"}},{
className:{1:"keyword",3:"keyword",4:"variable"}},{ begin:[/(let|const)/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{
1:"keyword",3:"keyword",4:"variable"}},{
begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword", begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",
3:"title.class"}},{ 3:"title.class"}},{
begin:[/(?:trait|enum|struct|impl|for|library)/,/\s+/,e.UNDERSCORE_IDENT_RE], begin:[/(?:trait|enum|struct|impl|for|library|abi)/,/\s+/,e.UNDERSCORE_IDENT_RE],
className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{ className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{
keyword:"Self",built_in:i}},{className:"punctuation",begin:"->"},t]}}}) keyword:"Self",built_in:[]}},{className:"punctuation",begin:"->"},t]}}})
;const ee=Q;for(const e of Object.keys(Y)){ ;const ie=te;for(const e of Object.keys(ne)){
const t=e.replace("grmr_","").replace("_","-");ee.registerLanguage(t,Y[e])} const t=e.replace("grmr_","").replace("_","-");ie.registerLanguage(t,ne[e])}
return ee}() return ie}()
;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); ;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);

View file

@ -22,17 +22,21 @@ export default function(hljs) {
const NUMBER_SUFFIX = '([u](8|16|32|64))\?'; const NUMBER_SUFFIX = '([u](8|16|32|64))\?';
const KEYWORDS = [ const KEYWORDS = [
"abi",
"as", "as",
"asm", "asm",
"const",
"contract", "contract",
"deref", "deref",
"enum", "enum",
"fn", "fn",
"if",
"impl", "impl",
"let", "let",
"library", "library",
"match", "match",
"mut", "mut",
"else",
"predicate", "predicate",
"ref", "ref",
"return", "return",
@ -54,20 +58,16 @@ export default function(hljs) {
]; ];
const TYPES = [ const TYPES = [
"u8", "bool", "char", "u8", "u16", "u32", "u64", "b256", "str", "Self"
"u16",
"u32",
"u64",
]; ];
return { return {
name: 'Sway', name: 'Sway',
aliases: [ 'sw' ], aliases: [ 'sw' ],
keywords: { keywords: {
$pattern: hljs.IDENT_RE + '!?', $pattern: hljs.IDENT_RE + '!?',
type: TYPES,
keyword: KEYWORDS, keyword: KEYWORDS,
literal: LITERALS, literal: LITERALS,
built_in: BUILTINS built_in: TYPES
}, },
illegal: '</', illegal: '</',
contains: [ contains: [
@ -126,7 +126,7 @@ export default function(hljs) {
}, },
{ {
begin: [ begin: [
/let/, /\s+/, /(let|const)/, /\s+/,
/(?:mut\s+)?/, /(?:mut\s+)?/,
hljs.UNDERSCORE_IDENT_RE hljs.UNDERSCORE_IDENT_RE
], ],
@ -149,7 +149,7 @@ export default function(hljs) {
}, },
{ {
begin: [ begin: [
/(?:trait|enum|struct|impl|for|library)/, /(?:trait|enum|struct|impl|for|library|abi)/,
/\s+/, /\s+/,
hljs.UNDERSCORE_IDENT_RE hljs.UNDERSCORE_IDENT_RE
], ],