| 16 | }function r(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] |
| 17 | ;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n} |
| 18 | const s=e=>!!e.scope||e.sublanguage&&e.language;class o{constructor(e,t){ |
| 19 | this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ |
| 20 | this.buffer+=i(e)}openNode(e){if(!s(e))return;let t="" |
| 21 | ;t=e.sublanguage?"language-"+e.language:((e,{prefix:t})=>{if(e.includes(".")){ |
| 22 | const n=e.split(".") |
| 23 | ;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") |
| 24 | }return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)} |
| 25 | closeNode(e){s(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){ |
| 26 | this.buffer+=`<span class="${e}">`}}const a=(e={})=>{const t={children:[]} |
| 27 | ;return Object.assign(t,e),t};class c{constructor(){ |
| 28 | this.rootNode=a(),this.stack=[this.rootNode]}get top(){ |
| 29 | return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ |
nothing calls this directly
no outgoing calls
no test coverage detected