use brokk_bifrost_core::analyzer::CodeUnit;
use brokk_bifrost_core::analyzer::Language;
use brokk_bifrost_core::analyzer::ProjectFile;
use brokk_bifrost_core::analyzer::language_knowledge::LanguageKnowledge;
use brokk_bifrost_core::analyzer::language_knowledge::ParserFlavor;
use brokk_bifrost_core::analyzer::project::Project;
use brokk_bifrost_core::analyzer::structural::spec::StructuralSpec;
pub struct PythonKnowledge;
impl LanguageKnowledge for PythonKnowledge {
fn unmarked_member_stores(
&self,
) -> brokk_bifrost_core::analyzer::language_knowledge::UnmarkedMemberStores {
brokk_bifrost_core::analyzer::language_knowledge::UnmarkedMemberStores::Followable
}
fn declared_type_is_referent_immutable(&self, _canonical_type: &str) -> bool {
false
}
fn call_applicability_may_select_callee(&self) -> bool {
false
}
fn callable_result_is_applicability_independent(&self) -> bool {
true
}
fn external_callee_expansion_requires_receiver_binding(&self) -> bool {
true
}
fn exact_external_call_keeps_import_boundary(&self) -> bool {
true
}
fn model_declarations_project_runtime_values(&self) -> bool {
true
}
fn model_declarations_supply_runtime_bases(&self) -> bool {
true
}
fn intrinsic_owners_use_source_member_rules(&self) -> bool {
true
}
fn qualified_type_lookups_use_value_namespace(&self) -> bool {
true
}
fn callable_expression_type_gap_is_value_only(&self) -> bool {
true
}
fn owned_members_are_not_lexically_scoped(&self) -> bool {
true
}
fn reassignments_are_one_declaration(&self) -> bool {
true
}
fn keyed_property_reads_container_element(&self) -> bool {
true
}
fn language(&self) -> Language {
Language::Python
}
fn path_synthetic_module_unit(
&self,
project: &dyn Project,
file: &ProjectFile,
) -> Option<CodeUnit> {
use crate::declarations::module_code_unit;
module_code_unit(project, file)
}
fn parser_language(&self, _flavor: ParserFlavor) -> tree_sitter::Language {
tree_sitter_python::LANGUAGE.into()
}
fn structural_spec(&self) -> &'static dyn StructuralSpec {
&crate::structural::PYTHON_STRUCTURAL_SPEC
}
fn highlight_query(&self) -> Option<&'static str> {
Some(tree_sitter_python::HIGHLIGHTS_QUERY)
}
}