mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
rename Unreachable -> Rethrow
This commit is contained in:
parent
9dd02ea090
commit
e005dbde4c
5 changed files with 15 additions and 20 deletions
|
@ -762,7 +762,7 @@ pub enum Stmt<'a> {
|
|||
ret_layout: Layout<'a>,
|
||||
},
|
||||
Ret(Symbol),
|
||||
Unreachable,
|
||||
Rethrow,
|
||||
Inc(Symbol, &'a Stmt<'a>),
|
||||
Dec(Symbol, &'a Stmt<'a>),
|
||||
Join {
|
||||
|
@ -911,11 +911,6 @@ pub enum CallType<'a> {
|
|||
},
|
||||
}
|
||||
|
||||
// x = f a b c; S
|
||||
//
|
||||
//
|
||||
// invoke x = f a b c in S else Unreachable
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Expr<'a> {
|
||||
Literal(Literal<'a>),
|
||||
|
@ -1133,7 +1128,7 @@ impl<'a> Stmt<'a> {
|
|||
symbol,
|
||||
call,
|
||||
pass,
|
||||
fail: Stmt::Unreachable,
|
||||
fail: Stmt::Rethrow,
|
||||
..
|
||||
} => alloc
|
||||
.text("let ")
|
||||
|
@ -1166,7 +1161,7 @@ impl<'a> Stmt<'a> {
|
|||
.append(symbol_to_doc(alloc, *symbol))
|
||||
.append(";"),
|
||||
|
||||
Unreachable => alloc.text("unreachable;"),
|
||||
Rethrow => alloc.text("unreachable;"),
|
||||
|
||||
Switch {
|
||||
cond_symbol,
|
||||
|
@ -4572,7 +4567,7 @@ fn substitute_in_stmt_help<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
Unreachable => None,
|
||||
Rethrow => None,
|
||||
|
||||
RuntimeError(_) => None,
|
||||
}
|
||||
|
@ -5293,7 +5288,7 @@ fn build_call<'a>(
|
|||
hole: &'a Stmt<'a>,
|
||||
) -> Stmt<'a> {
|
||||
if can_throw_exception(&call) {
|
||||
let fail = env.arena.alloc(Stmt::Unreachable);
|
||||
let fail = env.arena.alloc(Stmt::Rethrow);
|
||||
Stmt::Invoke {
|
||||
symbol: assigned,
|
||||
call,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue