pub struct CallGraph { /* private fields */ }Expand description
A call graph representing which words call which other words.
Implementations§
Source§impl CallGraph
impl CallGraph
Sourcepub fn build(program: &Program) -> Self
pub fn build(program: &Program) -> Self
Build a call graph from a program.
This extracts all word-to-word call relationships, including calls within quotations, if branches, and match arms.
Sourcepub fn is_recursive(&self, word: &str) -> bool
pub fn is_recursive(&self, word: &str) -> bool
Check if a word is part of any recursive cycle (direct or mutual).
Sourcepub fn are_mutually_recursive(&self, word1: &str, word2: &str) -> bool
pub fn are_mutually_recursive(&self, word1: &str, word2: &str) -> bool
Check if two words are in the same recursive cycle (mutually recursive).
Sourcepub fn recursive_cycles(&self) -> &[HashSet<String>]
pub fn recursive_cycles(&self) -> &[HashSet<String>]
Get all recursive cycles (SCCs with recursion).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallGraph
impl RefUnwindSafe for CallGraph
impl Send for CallGraph
impl Sync for CallGraph
impl Unpin for CallGraph
impl UnwindSafe for CallGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more