pub fn process_macros(expr: &Expr, macros: &[Macro]) -> WeldResult<Expr> {
    let mut macro_map: HashMap<Symbol, &Macro> = HashMap::new();
    for m in macros {
        if macro_map.contains_key(&m.name) {
            return compile_err!("Duplicate macro: {}", m.name);
        } else {
            macro_map.insert(m.name.clone(), &m);
        }
    }

    let mut sym_gen = SymbolGenerator::from_expression(&expr);

    let mut expr = expr.clone();
    for _ in 1..MAX_MACRO_DEPTH {
        if !apply_macros(&mut expr, &macro_map, &mut sym_gen)? {
            return Ok(expr);
        }
    }

    compile_err!("Marco expansion recursed past {} levels", MAX_MACRO_DEPTH)
}
Apply a specific list of macros to an expression (does not load the standard macros).
weld/src/syntax/macro_processor.rs