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

Function skipTriviaToGroup

src/extraction/languages/pascal-preparse.ts:577–584  ·  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

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

Callers 1

Calls 4

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

Tested by

no test coverage detected