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-python-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 distribution;
30pub mod exception_identity;
31pub mod format_string;
32pub mod graph;
33pub mod graph_support;
34pub mod imports;
35pub mod intrinsics;
36pub mod queries;
37mod regex;
38pub use regex::{decode_python_fstring_literal_segments, decode_python_string_value};
39#[cfg(any(test, feature = "test-support"))]
40mod resolution;
41pub mod runtime_values;
42pub mod source_facts;
43mod source_properties;
44pub mod structural;
45pub mod syntax;
46pub mod test_detection;
47pub mod usage_index;
48
49mod knowledge;
50pub use knowledge::PythonKnowledge;