MCPcopy Create free account
hub / github.com/Open-Quant/openquant / main

Function main

scripts/generate_api_inventory.py:66–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 out[module] = sorted(set(fns))
65 return out
66
67
68def public_rust_modules() -> set[str]:
69 """Module paths rustdoc documents: every `pub mod` reachable from the crate root."""
70 src = CRATES / "openquant" / "src"
71 out: set[str] = set()
72
73 def walk(prefix: str, file: Path, directory: Path) -> None:
74 for line in file.read_text(encoding="utf-8").splitlines():
75 m = re.match(r"^pub\s+mod\s+([A-Za-z0-9_]+)\s*;", line)
76 if not m:
77 continue
78 name = m.group(1)
79 path = f"{prefix}::{name}"
80 out.add(path)
81 sub_dir = directory / name
82 if (sub_dir / "mod.rs").exists():
83 walk(path, sub_dir / "mod.rs", sub_dir)
84 elif (directory / f"{name}.rs").exists() and sub_dir.is_dir():
85 walk(path, directory / f"{name}.rs", sub_dir)
86
87 walk("openquant", src / "lib.rs", src)
88 return out

Callers 1

Calls 3

scan_rustFunction · 0.85
scan_pythonFunction · 0.85
as_tsFunction · 0.85

Tested by

no test coverage detected