brokk_bifrost_python/lib.rs
1//! Python language knowledge for Bifrost.
2//!
3//! Internal implementation detail of `brokk-bifrost`; no stability guarantees --
4//! depend on `brokk-bifrost` instead.
5//!
6//! This crate sits between [`brokk_bifrost_core`] and `brokk-bifrost-analysis`.
7//! It holds Python *language knowledge* -- module identity, the declaration
8//! walk, import parsing and binding, the structural spec, test detection,
9//! lexical scope bindings, the export/importer usage index, and the usage-graph
10//! forward and inverted scans -- as plain functions and data. It depends on no
11//! other Bifrost crate than core, so nothing here may name `IAnalyzer`,
12//! `TreeSitterAnalyzer`, or `PythonAnalyzer`.
13//!
14//! Where analysis code would reach for an analyzer handle, the functions here
15//! take [`graph_support::PythonSource`] (or
16//! [`graph_support::PythonUsageSource`] once the usage index exists) -- a core
17//! [`brokk_bifrost_core::analyzer::CodeUnitIndex`] plus the memoized per-file
18//! products Python resolves through. `analyzer/python/` in
19//! `brokk-bifrost-analysis` keeps the shim: the `PythonAnalyzer` struct and its
20//! six moka caches and two `OnceLock`s, the accessors that implement those two
21//! traits, the `PythonAdapter` forwarding shell, the SPI block, and the
22//! downcasts that produce the arguments.
23
24pub mod adapter;
25pub mod bindings;
26pub mod clones;
27pub mod declarations;
28pub mod diagnostics;
29pub mod graph;
30pub mod graph_support;
31pub mod imports;
32pub mod queries;
33pub mod structural;
34pub mod syntax;
35pub mod test_detection;
36pub mod usage_index;