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

Function addNamesBeforeAngle

src/resolution/cpp-template-instantiations.ts:292–300  ·  view source on GitHub ↗

Add the names `text` writes right before a `<`.

(text: string, names: Set<string>)

Source from the content-addressed store, hash-verified

290
291/** Add the names `text` writes right before a `<`. */
292function addNamesBeforeAngle(text: string, names: Set<string>): void {
293 for (let open = text.indexOf('<'); open >= 0; open = text.indexOf('<', open + 1)) {
294 let end = open;
295 while (end > 0 && isSpace(text.charCodeAt(end - 1))) end--;
296 let start = end;
297 while (start > 0 && isWord(text.charCodeAt(start - 1))) start--;
298 if (start < end) names.add(text.slice(start, end));
299 }
300}
301
302/** The qualifiers `A<T>::B::` written right before `end`, outermost first, each with the arguments it writes. */
303function qualifiersBefore(text: string, end: number): Array<{ name: string; args: string[] | null }> {

Callers 1

readMethod · 0.85

Calls 3

isSpaceFunction · 0.70
isWordFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected