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

Function withoutLineComment

src/extraction/languages/cpp-macro-methods.ts:441–448  ·  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

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

Callers 1

cppMacroDirectivesFunction · 0.85

Calls 1

quotedEndFunction · 0.70

Tested by

no test coverage detected