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