Eliminate Stmt::RuntimeError in favor of crash

This commit is contained in:
Ayaz Hafiz 2022-11-22 18:08:33 -06:00
parent a2f2a18a76
commit 803d7e30e3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
14 changed files with 115 additions and 130 deletions

View file

@ -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,
}
}