()
| 88 | addRule(e,t){ |
| 89 | t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), |
| 90 | this.matchAt+=(e=>RegExp(e.toString()+"|").exec("").length-1)(e)+1}compile(){ |
| 91 | 0===this.regexes.length&&(this.exec=()=>null) |
| 92 | ;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(((e,t="|")=>{ |
| 93 | const n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;let s=0,r="" |
| 94 | ;for(let a=0;a<e.length;a++){s+=1;const i=s;let o=u(e[a]) |
| 95 | ;for(a>0&&(r+=t),r+="(";o.length>0;){const e=n.exec(o);if(null==e){r+=o;break} |
| 96 | r+=o.substring(0,e.index), |
| 97 | o=o.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+i):(r+=e[0], |
| 98 | "("===e[0]&&s++)}r+=")"}return r})(e),!0),this.lastIndex=0}exec(e){ |
| 99 | this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e) |
| 100 | ;if(!t)return null |
| 101 | ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),s=this.matchIndexes[n] |
no test coverage detected