MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _pascal_strip_comments

Function _pascal_strip_comments

graphify/extract.py:13115–13122  ·  view source on GitHub ↗

Strip Pascal comments ({}, (* *), //) while preserving newlines.

(text: str)

Source from the content-addressed store, hash-verified

13113
13114
13115def _pascal_strip_comments(text: str) -> str:
13116 """Strip Pascal comments ({}, (* *), //) while preserving newlines."""
13117 def _sub(m: re.Match) -> str:
13118 tok = m.group(0)
13119 if tok.startswith("'"):
13120 return tok
13121 return "".join(c if c == "\n" else " " for c in tok)
13122 return _PAS_TOKEN_RE.sub(_sub, text)
13123
13124
13125def _pascal_split_sections(text: str) -> tuple[str, int, str, int]:

Callers 1

_extract_pascal_regexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected