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

Method addRule

hyperagent-ext/media/scripts/highlight.min.js:141–142  ·  view source on GitHub ↗
(e,n)

Source from the content-addressed store, hash-verified

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
144 ;let t=n.exec(e)
145 ;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{

Callers 1

QFunction · 0.95

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected