mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-06 19:35:13 +02:00
* docs: Enhance module documentation across various files for clarity and completeness * fix: Remove unnecessary blank line in build.rs for cleaner code * docs: Update documentation to improve clarity and consistency in code comments
37 lines
1.4 KiB
Rust
37 lines
1.4 KiB
Rust
//! Explicit cross-language call-graph bridge edges.
|
|
//!
|
|
//! Without an [`InteropEdge`], the call graph resolver never attempts
|
|
//! cross-language resolution. This prevents false positives from functions
|
|
//! in different languages that happen to share a name.
|
|
//!
|
|
//! An [`InteropEdge`] maps a [`CallSiteKey`] (caller language, file, function,
|
|
//! callee symbol, call ordinal) to a [`FuncKey`] in another language. Ordinal
|
|
//! `0` acts as a wildcard matching any call of that name from the given caller.
|
|
|
|
use crate::symbol::{FuncKey, Lang};
|
|
|
|
/// Identifies a specific call site within a caller function.
|
|
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
|
pub struct CallSiteKey {
|
|
pub caller_lang: Lang,
|
|
/// Project-relative file path of the caller.
|
|
pub caller_namespace: String,
|
|
/// Enclosing function name at the call site.
|
|
pub caller_func: String,
|
|
/// The identifier at the call site (callee name as written).
|
|
pub callee_symbol: String,
|
|
/// Per-function call ordinal (0-based). `0` acts as a wildcard during
|
|
/// matching (matches any ordinal).
|
|
pub ordinal: u32,
|
|
}
|
|
|
|
/// An explicit cross-language bridge edge.
|
|
///
|
|
/// Connects a call site in one language to a function definition in another.
|
|
/// Without an `InteropEdge`, cross-language resolution is never attempted ,
|
|
/// this prevents false positives from name collisions across languages.
|
|
#[derive(Clone, Debug)]
|
|
pub struct InteropEdge {
|
|
pub from: CallSiteKey,
|
|
pub to: FuncKey,
|
|
}
|