MCPcopy Create free account
hub / github.com/Effect-TS/effect / add

Function add

packages/effect/src/IgnoreFile.ts:770–786  ·  view source on GitHub ↗
(list: Array<number>, start: number)

Source from the content-addressed store, hash-verified

768 let next: Array<number> = []
769 const stack: Array<number> = []
770 const add = (list: Array<number>, start: number) => {
771 stack.push(start)
772 while (stack.length > 0) {
773 const state = stack.pop()!
774 if (seen[state] === generation) {
775 continue
776 }
777 seen[state] = generation
778 list.push(state)
779 const token = tokens[state]
780 if (token?._tag === "Star" || token?._tag === "StarAll") {
781 stack.push(state + 1)
782 } else if (token?._tag === "GroupStart") {
783 stack.push(state + 2, state + 1)
784 }
785 }
786 }
787 add(current, 0)
788 for (let c = 0; c < path.length;) {
789 const code = path.codePointAt(c)!

Callers 3

parseSegmentFunction · 0.70
Context.tsFile · 0.70
matchTokensFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected