MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / getMatcher

Method getMatcher

hyperagent-ext/media/scripts/highlight.min.js:137–140  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

135 ;return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){
136 this.rules=[],this.multiRegexes=[],
137 this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){
138 if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t
139 ;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),
140 n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){
141 return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){
142 this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){
143 const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex

Callers 1

execMethod · 0.95

Calls 2

addRuleMethod · 0.95
compileMethod · 0.95

Tested by

no test coverage detected