MCPcopy
hub / github.com/tirth8205/code-review-graph / parse_file

Method parse_file

code_review_graph/parser.py:938–944  ·  view source on GitHub ↗

Parse a single file and return extracted nodes and edges.

(self, path: Path)

Source from the content-addressed store, hash-verified

936 return SHEBANG_INTERPRETER_TO_LANGUAGE.get(interpreter)
937
938 def parse_file(self, path: Path) -> tuple[list[NodeInfo], list[EdgeInfo]]:
939 """Parse a single file and return extracted nodes and edges."""
940 try:
941 source = path.read_bytes()
942 except (OSError, PermissionError):
943 return [], []
944 return self.parse_bytes(path, source)
945
946 def parse_bytes(self, path: Path, source: bytes) -> tuple[list[NodeInfo], list[EdgeInfo]]:
947 """Parse pre-read bytes and return extracted nodes and edges.

Calls 1

parse_bytesMethod · 0.95