Skip to main content

rewrite_recursive_calls_expr

Function rewrite_recursive_calls_expr 

Source
pub fn rewrite_recursive_calls_expr(
    expr: &Spanned<Expr>,
    targets: &HashSet<String>,
    fuel_var: &str,
) -> Spanned<Expr>
Expand description

AST transform: walk expr and replace every recursive call to a fn in targets with fn__fuel(fuel_var, …args). Inter-fn mutual calls in the same SCC are rewritten identically (the fuel parameter is threaded through the whole group).