docs(eval): update compile_if_else docstring for JumpIfCatchable opcode

Reflects control flow changes after cl/10288, documenting the new
JumpIfCatchable instruction and updated branching logic for catchable
defaults in conditional expressions.

Change-Id: I6a6a6964b84ae42e35ccb84851c7993619516d0b
Reviewed-on: https://cl.snix.dev/c/snix/+/30656
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
Reviewed-by: Oleksandr Knyshuk <olk@disr.it>
Autosubmit: Oleksandr Knyshuk <olk@disr.it>
This commit is contained in:
Oleksandr Knyshuk 2025-08-05 18:39:22 +02:00
parent 3475e61487
commit bd6cfb1e33

View file

@ -906,14 +906,15 @@ impl Compiler<'_, '_> {
/// Compile conditional expressions using jumping instructions in the VM.
///
/// ```notrust
/// ┌────────────────────┐
/// │ 0 [ conditional ] │
/// │ 1 JUMP_IF_FALSE →┼─┐
/// │ 2 [ main body ] │ │ Jump to else body if
/// ┌┼─3─← JUMP │ │ condition is false.
/// Jump over else body ││ 4 [ else body ]←┼─┘
/// if condition is true.└┼─5─→ ... │
/// └────────────────────┘
/// ┌─────────────────────┐
/// │ 0 [ conditional ] │
/// │ 1 JUMP_IF_CATCH →┼───┐ Jump over else body
/// │ 2 JUMP_IF_FALSE →┼─┐ │ if condition is catchable.
/// │ 3 [ main body ] │ │ ← Jump to else body if
/// ┌┼─4─← JUMP │ │ ← condition is false.
/// Jump over else body ││ 5 [ else body ] ←┼─┘ │
/// if condition is true.└┼─6─→ ... ←┼───┘
/// └─────────────────────┘
/// ```
fn compile_if_else(&mut self, slot: LocalIdx, node: &ast::IfElse) {
self.compile(slot, node.condition().unwrap());