MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / AstChunk

Class AstChunk

src/pyspector/ast_cache.py:46–52  ·  view source on GitHub ↗

Serialised AST for one top-level syntactic block.

Source from the content-addressed store, hash-verified

44
45@dataclass(frozen=True)
46class AstChunk:
47 """Serialised AST for one top-level syntactic block."""
48 chunk_id: str # "FunctionDef:my_func", "ClassDef:MyClass", "stmt:42"
49 start_line: int # 1-based, matches ast.lineno
50 end_line: int
51 content_hash: str # sha256 of this chunk's source text
52 ast_json_z: bytes # zlib-compressed JSON of the AstNode subtree
53
54
55@dataclass(frozen=True)

Callers 3

_deserialize_entryFunction · 0.85

Calls

no outgoing calls

Tested by 1