MCPcopy Create free account
hub / github.com/apache/fory / extract_cpp_code_blocks

Function extract_cpp_code_blocks

ci/extract_cpp_doc_code.py:38–48  ·  view source on GitHub ↗
(content: str)

Source from the content-addressed store, hash-verified

36
37
38def extract_cpp_code_blocks(content: str) -> List[Tuple[str, int]]:
39 # Extract C++ code blocks from markdown content.
40 code_blocks = []
41 pattern = r"```cpp\n(.*?)```"
42
43 for match in re.finditer(pattern, content, re.DOTALL):
44 code = match.group(1).strip()
45 line_num = content[: match.start()].count("\n") + 1
46 code_blocks.append((code, line_num))
47
48 return code_blocks
49
50
51def is_complete_example(code: str) -> bool:

Callers 1

process_markdown_fileFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected