From 8f1b75648081b69f4ff47263faea1843efdca6aa Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 7 Nov 2021 10:59:23 +1100 Subject: [PATCH] oceani: create separate scope for do part of while Any variables created in the do part won't be created in the final iteration, so we want them to be constrained to the do part, not seen as part of the whole loop body. This makes while/do match if/then better. Signed-off-by: NeilBrown --- csrc/oceani.mdc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index 122bcbc..1be7c67 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -3945,19 +3945,21 @@ casepart` to track a list of case parts. $*binode // This scope is closed in CondStatement - WhilePart -> while UseBlock OptNL do Block ${ + WhilePart -> while UseBlock OptNL do OpenBlock ${ $0 = new(binode); $0->op = Loop; $0->left = $right = $right = $op = Loop; $0->left = $right = $