mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Utility to substitute many symbols at once
This commit is contained in:
parent
1891df77b8
commit
fe9be63787
1 changed files with 12 additions and 0 deletions
|
@ -7098,6 +7098,18 @@ fn substitute_in_exprs<'a>(arena: &'a Bump, stmt: &mut Stmt<'a>, from: Symbol, t
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn substitute_in_exprs_many<'a>(
|
||||
arena: &'a Bump,
|
||||
stmt: &mut Stmt<'a>,
|
||||
subs: BumpMap<Symbol, Symbol>,
|
||||
) {
|
||||
// TODO clean this up
|
||||
let ref_stmt = arena.alloc(stmt.clone());
|
||||
if let Some(new) = substitute_in_stmt_help(arena, ref_stmt, &subs) {
|
||||
*stmt = new.clone();
|
||||
}
|
||||
}
|
||||
|
||||
fn substitute_in_stmt_help<'a>(
|
||||
arena: &'a Bump,
|
||||
stmt: &'a Stmt<'a>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue