MCPcopy Create free account
hub / github.com/idank/explainshell / addRule

Method addRule

explainshell/web/static/js/highlight.min.js:129–131  ·  view source on GitHub ↗
(e,t)

Source from the content-addressed store, hash-verified

127 }class n{constructor(){
128 this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
129 addRule(e,t){
130 t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),
131 this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
132 ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|"
133 }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
134 ;const t=this.matcherRe.exec(e);if(!t)return null

Callers 1

getMatcherMethod · 0.95

Calls 1

pFunction · 0.70

Tested by

no test coverage detected