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