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