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

Function withoutLineComment

src/extraction/languages/cpp-macro-methods.ts:442–449  ·  view source on GitHub ↗

A spliced directive without the `//` comment that ends it, one in a string literal aside.

(text: string)

Source from the content-addressed store, hash-verified

440
441/** A spliced directive without the `//` comment that ends it, one in a string literal aside. */
442function withoutLineComment(text: string): string {
443 for (let i = 0; i < text.length; i++) {
444 const c = text[i];
445 if (c === '"' || c === "'") i = quotedEnd(text, i) - 1;
446 else if (c === '/' && text[i + 1] === '/') return text.slice(0, i);
447 }
448 return text;
449}
450
451/** Past blanks and comments from `i`. */
452function skipBlankAndComments(source: string, i: number): number {

Callers 1

cppMacroDirectivesFunction · 0.85

Calls 1

quotedEndFunction · 0.70

Tested by

no test coverage detected