MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / skipTriviaToGroup

Function skipTriviaToGroup

src/extraction/languages/pascal-preparse.ts:582–589  ·  view source on GitHub ↗

The index of the first character from `i` that is neither whitespace nor in a comment, stopping at a conditional group's opening directive.

(s: string, i: number, groupAt: ReadonlyMap<number, ConditionalGroup>)

Source from the content-addressed store, hash-verified

580
581/** The index of the first character from `i` that is neither whitespace nor in a comment, stopping at a conditional group's opening directive. */
582function skipTriviaToGroup(s: string, i: number, groupAt: ReadonlyMap<number, ConditionalGroup>): number {
583 while (i < s.length) {
584 if (isSpace(s.charCodeAt(i))) i++;
585 else if (isCommentStart(s, i) && !groupAt.has(i)) i = commentOrStringEnd(s, i);
586 else break;
587 }
588 return i;
589}
590
591/**
592 * From `i`, the index after a routine header's `;`, blank the directives of

Callers 2

Calls 4

isCommentStartFunction · 0.85
commentOrStringEndFunction · 0.85
hasMethod · 0.80
isSpaceFunction · 0.70

Tested by

no test coverage detected