pub struct MacroExpander {
pub stats: MacroExpansionStats,
pub config: MacroHandlingConfig,
}Expand description
Handles macro expansion and parsing for call graph extraction
Fields§
§stats: MacroExpansionStats§config: MacroHandlingConfigImplementations§
Source§impl MacroExpander
impl MacroExpander
pub fn new() -> Self
pub fn with_config(config: MacroHandlingConfig) -> Self
Sourcepub fn classify_macro_type(macro_name: &str) -> MacroType
pub fn classify_macro_type(macro_name: &str) -> MacroType
Classify a macro based on its name to determine parsing strategy
Sourcepub fn extract_macro_name(path: &Path) -> String
pub fn extract_macro_name(path: &Path) -> String
Extract macro name from a syn path
Sourcepub fn handle_macro_expression(&mut self, expr_macro: &ExprMacro) -> Vec<Expr>
pub fn handle_macro_expression(&mut self, expr_macro: &ExprMacro) -> Vec<Expr>
Handle macro expression parsing
Sourcepub fn parse_bracketed_exprs(&self, tokens: &TokenStream) -> Result<Vec<Expr>>
pub fn parse_bracketed_exprs(&self, tokens: &TokenStream) -> Result<Vec<Expr>>
Parse bracketed expressions [expr1, expr2, …]
Sourcepub fn parse_braced_exprs(&self, tokens: &TokenStream) -> Result<Vec<Expr>>
pub fn parse_braced_exprs(&self, tokens: &TokenStream) -> Result<Vec<Expr>>
Parse braced expressions {expr1, expr2, …}
Sourcepub fn parse_comma_separated_exprs(
&self,
tokens: &TokenStream,
) -> Result<Vec<Expr>>
pub fn parse_comma_separated_exprs( &self, tokens: &TokenStream, ) -> Result<Vec<Expr>>
Parse comma-separated expressions
Sourcepub fn report_macro_stats(&self)
pub fn report_macro_stats(&self)
Report macro expansion statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MacroExpander
impl RefUnwindSafe for MacroExpander
impl Send for MacroExpander
impl Sync for MacroExpander
impl Unpin for MacroExpander
impl UnwindSafe for MacroExpander
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more