Skip to main content

compute_dbg_replacement

Function compute_dbg_replacement 

Source
fn compute_dbg_replacement(
    macro_expr: MacroExpr,
    make: &SyntaxFactory,
) -> Option<(Vec<NodeOrToken<SyntaxNode, SyntaxToken>>, Option<Expr>)>
Expand description

Returns None when either

  • macro call is not dbg!()
  • any node inside dbg!() could not be parsed as an expression
  • (macro_expr has no parent - is that possible?)

Returns Some(_, None) when the macro call should just be removed.