mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
add inc field to Inc instruction
This commit is contained in:
parent
5a2b2cbcac
commit
15cbadf652
6 changed files with 21 additions and 14 deletions
|
@ -52,7 +52,7 @@ pub fn occuring_variables(stmt: &Stmt<'_>) -> (MutSet<Symbol>, MutSet<Symbol>) {
|
|||
|
||||
Rethrow => {}
|
||||
|
||||
Inc(symbol, cont) | Dec(symbol, cont) => {
|
||||
Inc(symbol, _, cont) | Dec(symbol, cont) => {
|
||||
result.insert(*symbol);
|
||||
stack.push(cont);
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ impl<'a> Context<'a> {
|
|||
return stmt;
|
||||
}
|
||||
|
||||
self.arena.alloc(Stmt::Inc(symbol, stmt))
|
||||
self.arena.alloc(Stmt::Inc(symbol, 1, stmt))
|
||||
}
|
||||
|
||||
fn add_dec(&self, symbol: Symbol, stmt: &'a Stmt<'a>) -> &'a Stmt<'a> {
|
||||
|
@ -851,7 +851,7 @@ impl<'a> Context<'a> {
|
|||
(switch, case_live_vars)
|
||||
}
|
||||
|
||||
RuntimeError(_) | Inc(_, _) | Dec(_, _) => (stmt, MutSet::default()),
|
||||
RuntimeError(_) | Inc(_, _, _) | Dec(_, _) => (stmt, MutSet::default()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ pub fn collect_stmt(
|
|||
vars
|
||||
}
|
||||
|
||||
Inc(symbol, cont) | Dec(symbol, cont) => {
|
||||
Inc(symbol, _, cont) | Dec(symbol, cont) => {
|
||||
vars.insert(*symbol);
|
||||
collect_stmt(cont, jp_live_vars, vars)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue