MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / i

Class i

pages/viewScriptSource/libs/highlight.min.js:135–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133;const t=this.matcherRe.exec(e);if(!t)return null
134;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n]
135;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){
136this.rules=[],this.multiRegexes=[],
137this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){
138if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n
139;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),
140t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){
141return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){
142this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){
143const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex
144;let n=t.exec(e)
145;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{
146const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}
147return n&&(this.regexIndex+=n.position+1,
148this.regexIndex===this.count&&this.considerAll()),n}}
149if(e.compilerExtensions||(e.compilerExtensions=[]),
150e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
151;return e.classNameAliases=r(e.classNameAliases||{}),function n(s,o){const a=s

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected