Skip to content

Commit

Permalink
handling cases where the conditional is not the return
Browse files Browse the repository at this point in the history
  • Loading branch information
ACassimiro committed Sep 12, 2024
1 parent f0c38d9 commit 4d7d24a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rust-semantics/execution/conditionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
module RUST-CONDITIONALS-EVALUATION
imports RUST-SHARED-SYNTAX
imports RUST-VALUE-SYNTAX
rule (if ptrValue(_, true) S:BlockExpression):ExpressionWithBlock => S
rule (if ptrValue(_, false) _:BlockExpression):ExpressionWithBlock => .
rule S:ExpressionWithBlock ; => S
rule (if ptrValue(_, true) S:BlockExpression):ExpressionWithBlock => S [owise]
rule (if ptrValue(_, false) _:BlockExpression):ExpressionWithBlock => . [owise]
// rule (if ptrValue(_, false) _:BlockExpression):ExpressionWithBlock ;=> .
rule (if ptrValue(_, true) A:BlockExpression else _:IfElseExpression):ExpressionWithBlock => A
rule (if ptrValue(_, false) _:BlockExpression else B:IfElseExpression):ExpressionWithBlock => B
Expand Down

0 comments on commit 4d7d24a

Please sign in to comment.