| 218 | k.scope&&M.closeNode(),k.skip||k.subLanguage||(A+=k.relevance),k=k.parent |
| 219 | }while(k!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:t.length} |
| 220 | let h={};function y(a,r){const o=r&&r[0];if(S+=a,null==o)return g(),0 |
| 221 | ;if("begin"===h.type&&"end"===r.type&&h.index===r.index&&""===o){ |
| 222 | if(S+=n.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) |
| 223 | ;throw n.languageName=e,n.badRule=h.rule,n}return 1} |
| 224 | if(h=r,"begin"===r.type)return(e=>{ |
| 225 | const n=e[0],a=e.rule,i=new t(a),r=[a.__beforeBegin,a["on:begin"]] |
| 226 | ;for(const t of r)if(t&&(t(e,i),i.isMatchIgnored))return p(n) |
| 227 | ;return a.skip?S+=n:(a.excludeBegin&&(S+=n), |
| 228 | g(),a.returnBegin||a.excludeBegin||(S=n)),b(a,e),a.returnBegin?0:n.length})(r) |
| 229 | ;if("illegal"===r.type&&!i){ |
| 230 | const e=Error('Illegal lexeme "'+o+'" for mode "'+(k.scope||"<unnamed>")+'"') |
| 231 | ;throw e.mode=k,e}if("end"===r.type){const e=_(r);if(e!==ee)return e} |
| 232 | if("illegal"===r.type&&""===o)return 1 |
| 233 | ;if(T>1e5&&T>3*r.index)throw Error("potential infinite loop, way more iterations than matches") |
| 234 | ;return S+=o,o.length}const w=v(e) |
| 235 | ;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"') |
| 236 | ;const N=Q(w);let O="",k=r||N;const x={},M=new d.__emitter(d);(()=>{const e=[] |
| 237 | ;for(let n=k;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) |