MCPcopy
hub / github.com/colbymchenry/codegraph / looksLikeCpp

Function looksLikeCpp

src/extraction/grammars.ts:303–306  ·  view source on GitHub ↗

* Heuristic: does a .h file contain C++ constructs? * Checks the first ~8KB for patterns that are unique to C++ and never valid C.

(source: string)

Source from the content-addressed store, hash-verified

301 * Checks the first ~8KB for patterns that are unique to C++ and never valid C.
302 */
303function looksLikeCpp(source: string): boolean {
304 const sample = source.substring(0, 8192);
305 return /\bnamespace\b|\bclass\s+\w+\s*[:{]|\btemplate\s*<|\b(?:public|private|protected)\s*:|\bvirtual\b|\busing\s+(?:namespace\b|\w+\s*=)/.test(sample);
306}
307
308/**
309 * Heuristic: does a .h file contain Objective-C constructs?

Callers 1

detectLanguageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected