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

Function stripCommentsForRegex

src/resolution/strip-comments.ts:202–227  ·  view source on GitHub ↗
(content: string, lang: CommentLang)

Source from the content-addressed store, hash-verified

200 | 'erlang';
201
202export function stripCommentsForRegex(content: string, lang: CommentLang): string {
203 switch (lang) {
204 case 'python':
205 return stripPython(content);
206 case 'ruby':
207 return stripRuby(content);
208 case 'rust':
209 return stripRust(content);
210 case 'erlang':
211 return stripErlang(content);
212 case 'php':
213 return stripPhp(content);
214 case 'go':
215 return stripGo(content);
216 case 'javascript':
217 case 'typescript':
218 case 'java':
219 case 'csharp':
220 case 'swift':
221 case 'c':
222 case 'cpp':
223 return stripCStyle(content, /* allowSingleQuoteStrings */ lang === 'javascript' || lang === 'typescript');
224 default:
225 return content;
226 }
227}
228
229/**
230 * A source with ranges blanked, keeping newlines so line numbers computed

Callers 15

commonJsRequireRefsFunction · 0.90
statedDefaultExportFunction · 0.90
pythonStarExportsFunction · 0.90
isBrowserCodeFunction · 0.90
extractImportMappingsFunction · 0.90
extractPythonImportsFunction · 0.90
extractGoImportsFunction · 0.90
extractPythonReExportsFunction · 0.90
componentsInFunction · 0.90
writesClassBeforeFunction · 0.90
assignedCalleesMethod · 0.90

Calls 7

stripPythonFunction · 0.85
stripRubyFunction · 0.85
stripRustFunction · 0.85
stripErlangFunction · 0.85
stripPhpFunction · 0.85
stripGoFunction · 0.85
stripCStyleFunction · 0.85

Tested by

no test coverage detected