mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Eliminate Stmt::RuntimeError in favor of crash
This commit is contained in:
parent
a2f2a18a76
commit
803d7e30e3
14 changed files with 115 additions and 130 deletions
|
@ -241,7 +241,7 @@ fn function_s<'a, 'i>(
|
|||
}
|
||||
}
|
||||
|
||||
Ret(_) | Jump(_, _) | RuntimeError(_) | Crash(..) => stmt,
|
||||
Ret(_) | Jump(_, _) | Crash(..) => stmt,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,9 +535,7 @@ fn function_d_main<'a, 'i>(
|
|||
|
||||
(arena.alloc(new_join), found)
|
||||
}
|
||||
Ret(_) | Jump(_, _) | RuntimeError(_) | Crash(..) => {
|
||||
(stmt, has_live_var(&env.jp_live_vars, stmt, x))
|
||||
}
|
||||
Ret(_) | Jump(_, _) | Crash(..) => (stmt, has_live_var(&env.jp_live_vars, stmt, x)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -698,7 +696,7 @@ fn function_r<'a, 'i>(env: &mut Env<'a, 'i>, stmt: &'a Stmt<'a>) -> &'a Stmt<'a>
|
|||
arena.alloc(expect)
|
||||
}
|
||||
|
||||
Ret(_) | Jump(_, _) | RuntimeError(_) | Crash(..) => {
|
||||
Ret(_) | Jump(_, _) | Crash(..) => {
|
||||
// terminals
|
||||
stmt
|
||||
}
|
||||
|
@ -764,7 +762,6 @@ fn has_live_var<'a>(jp_live_vars: &JPLiveVarMap, stmt: &'a Stmt<'a>, needle: Sym
|
|||
arguments.iter().any(|s| *s == needle) || jp_live_vars[id].contains(&needle)
|
||||
}
|
||||
Crash(m, _) => *m == needle,
|
||||
RuntimeError(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue