MCPcopy Create free account
hub / github.com/Snapchat/Valdi / _strip_comments

Function _strip_comments

tools/api_surface/extract_api.py:15–19  ·  view source on GitHub ↗

Remove block comments and single-line comments.

(text: str)

Source from the content-addressed store, hash-verified

13
14
15def _strip_comments(text: str) -> str:
16 """Remove block comments and single-line comments."""
17 text = re.sub(r"/\*[\s\S]*?\*/", "", text)
18 text = re.sub(r"//.*$", "", text, flags=re.MULTILINE)
19 return text
20
21
22def _normalize_type(t: str) -> str:

Callers 3

_parse_propertiesFunction · 0.85
_parse_class_methodsFunction · 0.85
extract_apiFunction · 0.85

Calls 1

subMethod · 0.65

Tested by

no test coverage detected