From: NeilBrown Date: Sat, 6 Nov 2021 23:59:23 +0000 (+1100) Subject: oceani: create separate scope for do part of while X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=8f1b75648081b69f4ff47263faea1843efdca6aa;hp=328f1ddba692ab946bde77f5cf8665ca4497d416 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 --- 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 = $