From 4d7d24a793d2cdaba327cb5997e764a839ca9a6c Mon Sep 17 00:00:00 2001 From: acassimiro Date: Wed, 11 Sep 2024 21:38:02 -0300 Subject: [PATCH] handling cases where the conditional is not the return --- rust-semantics/execution/conditionals.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rust-semantics/execution/conditionals.md b/rust-semantics/execution/conditionals.md index 0423b8d..b523822 100644 --- a/rust-semantics/execution/conditionals.md +++ b/rust-semantics/execution/conditionals.md @@ -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