MCPcopy Create free account
hub / github.com/JRickey/BattleShip / strip_comments

Function strip_comments

tools/pointer_audit.py:59–65  ·  view source on GitHub ↗

Remove // and /* */ comments.

(text)

Source from the content-addressed store, hash-verified

57# ---------------------------------------------------------------------------
58
59def strip_comments(text):
60 """Remove // and /* */ comments."""
61 # Block comments
62 text = re.sub(r'/\*.*?\*/', ' ', text, flags=re.DOTALL)
63 # Line comments
64 text = re.sub(r'//[^\n]*', '', text)
65 return text
66
67
68def extract_structs(text):

Callers 1

run_auditFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected