Skip to content

Commit

Permalink
Improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril authored Jul 16, 2024
1 parent 9f7c543 commit 2b51b53
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions charon/src/ast/llbc_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ pub struct Statement {
VariantIndexArity,
)]
pub enum Switch {
/// Gives the `if` block and the `else` block. The `Operand` is the "body" of the `if`, e.g. `if (y == 0)` becomes
/// `v@3 := copy y^1;
/// v@2 := move v@3 == (0: u32 : u32);
/// if (move v@2) {`
/// Gives the `if` block and the `else` block. The `Operand` is the condition of the `if`, e.g. `if (y == 0)` could become
/// ```
/// v@3 := copy y; // Represented as `Assign(v@3, Use(Copy(y))`
/// v@2 := move v@3 == 0; // Represented as `Assign(v@2, BinOp(BinOp::Eq, Move(y), Const(0)))`
/// if (move v@2) { // Represented as `If(Move(v@2), <then branch>, <else branch>)`
/// ```
If(Operand, Box<Statement>, Box<Statement>),
/// Gives the integer type, a map linking values to switch branches, and the
/// otherwise block. Note that matches over enumerations are performed by
Expand Down

0 comments on commit 2b51b53

Please sign in to comment.